Solved

Visual Basic/Access Project - Runtime Error 3001

Posted on 2003-11-05
5
3,075 Views
Last Modified: 2012-06-27
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.Refresh
        Adodc1.Recordset.AddNew
        Adodc1.Recordset("Vendor") = a
        Adodc1.Recordset.Update ("Vendor")
        j = j + 1
    Wend
   
End Sub

If anyone has any questions feel free to ask.
0
Comment
Question by:roman411
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:lttia1
ID: 9691410
Runtime error '3001':
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

Since you have used the code plenty of times, so i assume the application is running fine until recently.

Could there be embedded apostrophe in the data that you have retrieved?
eg. La corne d'abondance  
If this is the case, you can solve it by double the embedded apostrophe in the data.
0
 

Author Comment

by:roman411
ID: 9694390
Actually, I am reusing old code in a new program. The old code works for another program doing the exact same operations.

I checked the data and no apostrophies. I checked by hand just now.
0
 
LVL 27

Accepted Solution

by:
Zberteoc earned 125 total points
ID: 9696049
I don't think that Adodc1.Recordset.Update ("Vendor") needs an argument. A recordset is updated by the whole record and not only by one field, ("Vendor") in this case. Try simply:  Adodc1.Recordset.Update
0
 

Author Comment

by:roman411
ID: 9696493
It's funny you know. I have always used Adodc1.Recordset.Update ("Vendor")  and not Adodc1.Recordset.Update and it has always worked for me. Guess what? Kudos to you. And points as well. Thanks.
0
 
LVL 27

Expert Comment

by:Zberteoc
ID: 9697583
Thanks and I'm glad I could help. These are my fisrst points earned on EE. Goodluck in your work.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question