runtime error -2147467259 (80004005) "invalid argument"

RussellEngland

New member
Local time
Today, 15:53
Joined
Sep 9, 2008
Messages
2
Hi chaps

I'm running a little routine to import data from txt files. Its been running well and has processed 115,000 records until I got this error:

run-time error -2147467259 (80004005) "invalid argument"

The code with the error is
oconnect.Execute("insert into BookFields(Regno, FieldName, FieldValue) values(1066704,""XXXXXX"",""XXXX"")")

If I copy and paste the above into the debug window, I get the same error.

If I replace the values, I get the same error so it can't be the data.

If I stop and restart the program, it happens again almost immediately but with a different set of data.

I tried creating a copy of Bookfields with no data - restarting the program and got the same error after 340 records

The connection string is
dim oConnect as new ADODB.Connection
oConnect.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & CurrentDb.Name & ";"

Any ideas?

Thanks

Russ
 
Oh...

It looks like its because the mdb has reached 2gb - nothing to do with invalid arguments
 
Russell,

Thanks for posting back. I was starting to research this but saw your last
comment. If only more people would do that.

Thanks,
Wayne
 
Just an FYI for you. Don't open a connection using "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & CurrentDb.Name & ";" to the current db.

All you need to do is use

Set oConnect = CurrentProject.Connection

that will avoid problems with issues of locking and it telling you of "read only" situations and/or that another user has the table locked.
 

Users who are viewing this thread

Back
Top Bottom