Visual Basic/Access Project - Runtime Error 3001
Posted on 2003-11-05
I am having a problem. I have used this bit of code plenty of times but I am now getting the infamous "runtime error 30001". What I am trying to do is take some text in a .csv file and load it into an access database. There are tons of "fields" in the csv file but I only need the data from two. My Access database has three columns: ID (AutoGenerated Number), Vendor (text 255 characters), and Vendor_Vname (text 255 characters). I am trying to add the records via an ado data object (Adodc1). My plan was to loop through the .csv file and at each value update the Access database. Here's what I have now:
Private Sub Form_Load()
Dim i As Integer
Dim j As Integer
Dim a As String
i = FreeFile
Open "j:\idp_netaspx\IDP DOWNLOAD\EXPVEN.csv" For Input As #i
j = 0
Line Input #i, a
While Not EOF(i)
Input #i, a
Adodc1.ConnectionString = "Provider=Microsoft.jet.oledb.3.51; Data Source=o:\idp_download\old_lawson_clone.mdb"
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "lawson_apvenmast"
Adodc1.Recordset("Vendor") = a
j = j + 1
If anyone has any questions feel free to ask.