DAO -vs- ADO and Jet Error #s...

M

Mark Burns

OK, I'm well aware of the DAO Jet VBA Error #s as revealed by this:
http://msdn2.microsoft.com/en-us/library/Aa200518(office.10).aspx

However, when using ADO connections to the database in VBA instead of the
DAO connections, the error numbers get "ADO-ized", and we get the -2147467259
error codes instead of the nice, neat Error #3734 (for "The database has been
placed in a state by user <name> on machine <name> that prevents it from
being opened or locked.")

Is there a list somewhere of the ADO-ized Jet error codes, or must I figure
out and do the binary/hex math myself?

Oh, WooHoo! Nevermind on the question, as I just found this little gem online:
http://support.microsoft.com/default.aspx/kb/201476

So I'll just post this as a comment to all hopefully for others' benefit.

Hmm...perhaps I should create a general DB error-handing class that will
take the error numbers from DAO/Jet, ADO/JET, and/or the new ACE error #s and
return a useful "Fatal Error" flag and "friendly" message string for use in
all my initial form_open calls...so we can capture/set the Cancel value in
the Form_open appropriately in one
database-engine/db-access-technology-agnostic class module...
Hmmm...
I haven't played around with Access2007 enough to know how to answer this
one though:
In Access 2007, how does one know, via VBA, if the open database is opened
via JET, ACE, MSDE, ...?etc?.,.
Are the Application.CurrentDB, Application.CurrentProject properties the
same, or are the methods going to be different in 2007 requiring more
extensive logic to examine the Application.version value first and then be
able to check the "old" way for int(Access.version) <=11 and some other new
way for int(access.version) >= 12 ?
 

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

Similar Threads

Transaction problem between DAO and ADO 6
Jet connections 32
DAO vs ADO 5
DAO vs ADO and SQL Server 1
DAO IS DED 18
SQL string error message 1
Problem with DAO Vs ADO 9
ADO vs DAO 41

Top