Hi everyone,
I am attempting to access a database that is located in a shared server/ directory "K:\". Assuming I don't know where the database is located, how can I programatically tell vb to locate this database by searching all the network server directory?
My database name is called:
PTS.mdb

Currently I copied the database into my local drive
"C:\PTS.mdb" => for testing purposes.

This is how I'm accessing the database now:

Dbpath = "C:\" 
DbName = "PTS" 

Set Db = OpenDatabase(Dbpath & DbName) 

Any input will be greatly appreciated.
Thanks.
tgif

Sorry my previous post wasn't properly formated.

VB6 - Locate/Access Database in a Server directory

Hi everyone,
I am attempting to access a database that is located in a shared server/ directory "K:\". Assuming I don't know where the database is located, how can I programatically tell vb to locate this database by searching all the network server directory?
My database name is called:

PTS.mdb

Currently I copied the database into my local drive

"C:\PTS.mdb"

=> for testing purposes.

This is how I'm accessing the database now:

Dbpath = "C:\" 
DbName = "PTS" 

Set Db = OpenDatabase(Dbpath & DbName)

Any input will be greatly appreciated.
Thanks.
tgif

How do you expect the application to open the database without knowing its location. It never happens that application will run without knowing the location of an access database . You have the option of asking the user to specify the database location initially at the start of the application.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.