opening old MDB vs new MDB files
I have an absolutely outstanding sample application that I was given to demonstrate how to use VB to work with Access databases. It works wonderfully, but only on old MDB files, and I want to update it to work with Access 2000 MDB files.
The rub seems to be with this code:
Dim DB As Database
Set DB = OpenDatabase(txtPath, , True, "Access")
the txtPath is correct (it's selected from a common dialog box), but if it points to an old MDB file the open works fine and if it points to a new (Access 2000) MDB file, the open fails and give a message saying "unrecognized database format <filename>" where <filename> is the name of the file.
The person who gave me the file online (but who has declined to give me any help with it - hey, it was nice of him to provide it) suggested that I replace "Access" with "Access 4.0" but doing that changes nothing. In fact if I replace the "Access" with "junk" nothing changes, which seems really weird.
I've looked at everything I can find in the online help, particulary the OpenDatabase method, but can't find anything even mentioning the use of "Access" or "Access 4.0", much less why "junk" would work or why old files word and new files don't work.
Any help you can give will be appreciated. Thanks.
Paul
Re: opening old MDB vs new MDB files
[QUOTE]Originally posted by phinds
[B]I have an absolutely outstanding sample application that I was given to demonstrate how to use VB to work with Access databases. It works wonderfully, but only on old MDB files, and I want to update it to work with Access 2000 MDB files.
The rub seems to be with this code:
Dim DB As Database
Set DB = OpenDatabase(txtPath, , True, "Access")
the txtPath is correct (it's selected from a common dialog box), but if it points to an old MDB file the open works fine and if it points to a new (Access 2000) MDB file, the open fails and give a message saying "unrecognized database format <filename>" where <filename> is the name of the file.
What Provider are u using?
and how do you connect to your database
Send me your connection code