?
Solved

Invalid Argument

Posted on 2010-01-07
17
Medium Priority
?
710 Views
Last Modified: 2012-05-08
Hi,
I created a program in Access 2000 about 3 years ago and it hasn't had any problems until now.  There is a button on a form that runs code to import an excel file into a table.  I attached a screen shot of where the error is happening at.  The error says "Invalid Argument" and it is error code 3001.  This code has been working fine, so it is kind of blowing my mind that it is not working now.

I also tried to compact/repair the db, but the same "Invalid Argument" Error pops up when I do that! So what might be my problem??

Thanks,
Dave
accesserr.doc
0
Comment
Question by:coperations07
  • 4
  • 4
  • 4
  • +3
17 Comments
 
LVL 1

Expert Comment

by:jmghag
ID: 26205332
Are you importing and xls or xlsx file?
0
 
LVL 5

Expert Comment

by:fhillyer1
ID: 26205379
try removing the minus sign to the -1 at the end of the line
0
 
LVL 5

Expert Comment

by:fhillyer1
ID: 26205392
also if you have upgraded excel versions you should update the spreadsheettype accordingly
 acSpreadsheetTypeExcel3 (default)
 acSpreadsheetTypeExcel4
 acSpreadsheetTypeExcel5
 acSpreadsheetTypeExcel7
 acSpreadsheetTypeExcel8
 acSpreadsheetTypeExcel9
 acSpreadsheetTypeLotusWK1
 acSpreadsheetTypeLotusWK3
 acSpreadsheetTypeLotusWK4
 acSpreadsheetTypeLotusWJ2 Japanese version only
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 5

Expert Comment

by:fhillyer1
ID: 26205404
just in case here is the Microsoft Reference Link for Access 2000

http://msdn.microsoft.com/en-us/library/aa193071(office.10).aspx
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 26205479

check the excel file that you are importing?

or try another excel file that you know is good.

or try importing into a non existing table

0
 
LVL 26

Expert Comment

by:jerryb30
ID: 26206545
Did your db go to 2 gb?
0
 

Author Comment

by:coperations07
ID: 26209912
Wow. Thanks for all the suggestions guys!

The file to be imported is an xls file.
The program was written using Access 2000 and Access 2000 is still on the user's machine.

I tried removing the '-1' at the end of the statement, but it still gave the error. The xls file contains headers so the -1 is needed.

Versions haven't been upgraded, but I did try switching to 5 and 8, but still got the error.

I checked the excel file for anything that looked wierd, but nothing stuck out.
I removed every row except for one and the header row. Still got the error.
I tried importing a different xls file that had been imported, with the same program, correctly earlier in the day. It gives the same error.
I switched the table name to a non-existing table and got the same invalid argument msg.

Jerry, (it's early) what does gb stand for?

More troubleshooting:
I tried to import the xls file by going to Get External Data and importing it into a new table. Got the following msg:  "An error occurred trying to import file 'C:\Hof\Cmas.xls'. The file was not imported."

I tried using a different event that does the same thing except it imports into a different table. It gave the Invalid Argument error.
I also tried removing the default arguments of transferspreadsheet, still got the error.

Thanks for the help,
Dave



0
 

Author Comment

by:coperations07
ID: 26209925
This database is used by one user and it runs from his My Documents folder.  I copied the program to my pc and it is giving the same errror.
0
 
LVL 26

Accepted Solution

by:
jerryb30 earned 2000 total points
ID: 26212606
gigabytes=gb=Max size of Access db. If you are running a process which takes db to exactly 2gb, it will return Invalid Argument.
0
 

Author Comment

by:coperations07
ID: 26213046
I think you may be on to something jerry.  The db is 2,097,152 KB.
So I try to compact and I still get the error...
What can I do??
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 26213077
can you archived some records?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 26213107
if not, you can upgrade to Sql server
Sql server express is free.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 26213181
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 26213690
You need to import desired tables into a clean db.  
Your import process is probably causing a lot of bloat.
0
 
LVL 3

Expert Comment

by:ClarkFilter
ID: 26213696
Since the db is 2 GB, try creating a new database, import all the tables, queries, forms, etc. into the new database.
0
 

Author Comment

by:coperations07
ID: 26213812
I was able to delete several tables and it let me compact/repair.  It went down to 1800 KB, so that should be more manageable now.  It looks like everything is going to work fine now.  Guess I'll just have to make a note to do some maintenance on it every once in a while.

Thanks for the help!
Dave
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 26213892
Watch your import process the next time. See if that is what is causing your database to grow quickly.  If so, might try other process.  if it is just a file maintenance issue, set your db to compact on close.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

862 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