Log in

View Full Version : Export data from Access table to SharePoint list



shaman171
07-11-2015, 03:49 AM
Hello,

I have got some VBA code, which make me some variables from field in Access table. I make it with this tutorial:


Sub Example2()
Dim objRecordset As ADODB.Recordset
Set objRecordset = New ADODB.Recordset
Dim i As Integer
Dim arrValues(1 To 100) As Variant


'initated recordset obejct
objRecordset.ActiveConnection = CurrentProject.Connection
objRecordset.Open ("MyTable1")
i = 1
'keep going until the end of the recordset is reached
While objRecordset.EOF = False
arrValues(i) = objRecordset.Fields.Item(1)
i = i + 1
objRecordset.MoveNext
Wend
End Sub

Now I need to export this variables to the list on SharePoint and make from every variables new field. And I need to give a name to field. Via VBA.


Can you help me?

I found this:


oCmd.TransferDatabase transfertype:=acExport, databasetype:="WSS", _
databasename:="htt.p://example/WSSSite", _
objecttype:=acTable, Source:="Customers", _
Destination:="Customer List", structureonly:=False


but I don't know how to use it.

Thanks a lot!