Application Errors

C

Craig

If I double click on the database file to open the Access application I get
2 errors.

1) Sometimes the application can't find the files of data I want to import
into the application.
2) Sometimes when I exit Access I get the following error

Cannot open database 'c:\db1.mdb'. It may not be a database that you
application recognizes, or the file may be corrupt

but it is fine.


If I just open Access and click FILE, OPEN and browse to the database file,
no errors happen.


How can I let the user double click on the database file to open the
application without getting application errors?
I do not want to hard code any directories when doing file imports etc.

Thanks
 
M

Mike Labosh

If I just open Access and click FILE, OPEN and browse to the database
file,
no errors happen.

How can I let the user double click on the database file to open the
application without getting application errors?
I do not want to hard code any directories when doing file imports etc.

The only time I have ever seen this behavior is on a machine with more than
one different version of Access installed on it, and the problem is the file
association.

For Example:

1. Install Access 2003
2. Setup registers the .mdb file extension and associates it with Access
2003.
3. A user can double-click an mdb file and Access 2003 opens it.
4. Install Access 97 in a different directory.
5. Setup registers the .mdb file extension and associates it with Access 97
6. A user double-clicks an mdb file and Access 97 *tries* to open it, but
fails, because Access 97 cannot read the Access 2003 mdb file. All Access
97 knows is that it can't read the database, so it complains that it is
missing or corrupted or not a database.
7. The user launches Access 2003 and uses File->Open and can open it fine.
--
Peace & happy computing,

Mike Labosh, MCSD

Feed the children!
Save the whales!
Free the mallocs!
 
C

Craig

Thanks but let me clarify

I have and have had only 1 version of Access installed.

I can always open the application either way.

The errors occur when running a macro and it is looking for a specific file
name to import.

The other error, Cannot open database 'c:\db1.mdb'. It may not be a database
that you
application recognizes, or the file may be corrupt., occurs when I quit
Access.

Any ideas?
 
D

Dan Artuso

Hi,
There's no error handling in macros so I don't think there's much you can
do about (other than do the same thing in code and then trap the error).

For the second error, do you have the db set to compact on close?
 
D

Dan Artuso

Hi,
Try turning that off and see if the error goes away. In order to compact,
Access closes your db and makes a copy and if I'm not mistaken, it calls it db1.
Although I've never seen an error occur before.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top