954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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:[Code]
Dbpath = "C:\"
DbName = "PTS"

Set Db = OpenDatabase(Dbpath & DbName)


Any input will be greatly appreciated.
Thanks.
tgif

tgifgemini
Junior Poster
113 posts since Jul 2007
Reputation Points: 22
Solved Threads: 0
 

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

tgifgemini
Junior Poster
113 posts since Jul 2007
Reputation Points: 22
Solved Threads: 0
 

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.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You