G
Guest
I want to import data from a text file and the file name is Baby_Product.txt under C:\My Documents\TDC
I get error says 'C:\My Documents\TDC\Baby_Product.txt' is not a valid path. Appreciate some hint of my mistak. I am using ADO and my code is follows:
====== code starts ========
Dim cnn1 As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\My Documents\TDC\Baby_Product.txt;"
Set rst1 = New ADODB.Recordset
rst1.Open "Baby", cnn1, adOpenKeyset, adLockOptimistic, adCmdTable
rst1.MoveFirst
====== code ends ========
Many Thanks
I get error says 'C:\My Documents\TDC\Baby_Product.txt' is not a valid path. Appreciate some hint of my mistak. I am using ADO and my code is follows:
====== code starts ========
Dim cnn1 As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\My Documents\TDC\Baby_Product.txt;"
Set rst1 = New ADODB.Recordset
rst1.Open "Baby", cnn1, adOpenKeyset, adLockOptimistic, adCmdTable
rst1.MoveFirst
====== code ends ========
Many Thanks