Page 1 of 1

Select MDB to open

PostPosted: Mon Sep 29, 2014 5:14 pm
by BRobinsonS
I would like to select the database to open i.e. DBOne or DBTwo
The databases will have the same Tables and same structure.

Initial testing with FileOpenBox, opening the Database tells me DBOne or DBTwo does not exit.
I believe it has to do with Database ID. How do I use the same ID for two different MDBs but not at same time?

Re: Select MDB to open

PostPosted: Mon Sep 29, 2014 5:30 pm
by mishem
Code: Select all
FileOpenBox "" "MDB|*.mdb" "[PubDir]" "[FileName]" ""
dbpOpenAccessDatabase "ID" "[FileName]" ""


Or

Code: Select all
FileExists "[PubDir]DBOne.mdb" "[Result]"
If "[Result]" "=" "False"
    dbpCreateAccessDatabase "[PubDir]DBOne.mdb" "Password=;Encrypted=No"
EndIf

FileExists "[PubDir]DBTwo.mdb" "[Result]"
If "[Result]" "=" "False"
    dbpCreateAccessDatabase "[PubDir]DBTwo.mdb" "Password=;Encrypted=No"
EndIf
FileOpenBox "" "MDB|*.mdb" "[PubDir]" "[FileName]" ""
dbpOpenAccessDatabase "ID" "[FileName]" ""

Re: Select MDB to open

PostPosted: Mon Sep 29, 2014 8:11 pm
by BRobinsonS
May have found my problem.
The compile directory pointed to an old development directory.

So when I ran the pub to test, it wasn't finding the files in the current development directory.