Hello,
I have very little experience with programming and none with programming a database. I would like to import a csv file using a VB example:
Private Sub StartImport
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
strPathtoTextFile = "C:\Databases\"
'this specifies the pass where the csv files are located
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
objRecordset.Open "SELECT * FROM PhoneList.csv", objConnection
Do Until objRecordset.EOF
Wscript.Echo "Name: " & objRecordset.Fields.Item("Name")
Wscript.Echo "Department: " & _
objRecordset.Fields.Item("Department")
Wscript.Echo "Extension: " & objRecordset.Fields.Item("Extension")
objRecordset.MoveNext
Loop
End Sub
but
as expected this doesn't work at all
. Can anyone give me an example or hints how to import a csv file and (after that) how to write the records in a database which i have to create by code.
Greetings,
Ron.