Hi all,
I have an Access application that has to import hundreds of other
MDB's, some access 97 and some 2000, and merge them into several large
mdb's. so far so good, but my command:
Set appAccess = GetObject(Targe tDBPathNAme, "Access.Applica tion.9")
sometimes fails, of course, when the MDB to be imported is Access 97
type.
How do I determine in advance (before GetObject) what version a closed
(unaccessed) MDB is created with?
the best I have come up with, shamefully, was to use "On error"
detection
like this:
<the beginning of the import loop>
OpenImportConne ction = true
Set appAccess = GetObject(Targe tDBPathNAme, "Access.Applica tion.9")
OpenImportConne ction = false
< the error handling section >
If (Err.Number = 7866 Or InStr(1, Err.Description , "Microsoft Access
can't open the database because it is missing") > 0) And
OpenImportConne ction Then
' probably trying to open an Access 97 file as an Access 2000 version,
' so switch importing to version 97
Set appAccess = Nothing
Set appAccess = GetObject(Targe tDBPathNAme,
"Access.Applica tion.8")
Resume Next
End If
(I got two types of error mesasges occuring because of this).
is there anything better than this, that doesn't depend on
errorhandling?
Thanks for reading.
hh.