Opendatabase with variable

  • Thread starter Thread starter jokobe
  • Start date Start date
J

jokobe

Hi ng,

I'm using this code:
Set db = DBEngine.Workspaces(0).OpenDatabase("any")

Instead of the any string, I would like to have
a variable containing the actual path for the
database like this:

act_path = "c:\somewhere\my_db.mdb"
But, the opendatabase method doesn't seem to accept
the act_path variable.

Any helpfull hint??

Thanks in advance

jokobe
 
Try:
Dim db As DAO.Database
Set db = OpenDatabase(act_path)
'useful stuff
db.Close
Set db = Nothing
 
Thanks Allen,

it is working.

Joe
-----Original Message-----
Try:
Dim db As DAO.Database
Set db = OpenDatabase(act_path)
'useful stuff
db.Close
Set db = Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top