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 ?
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 ?