VB6 - Locate/Access Database in a Server directory

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

VB6 - Locate/Access Database in a Server directory

 
0
  #1
Nov 16th, 2007


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:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. PTS.mdb

Currently I copied the database into my local drive
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. "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
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

Re: VB6 - Locate/Access Database in a Server directory

 
0
  #2
Nov 16th, 2007
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:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. PTS.mdb

Currently I copied the database into my local drive
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. "C:\PTS.mdb"
=> for testing purposes.

This is how I'm accessing the database now:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dbpath = "C:\"
  2. DbName = "PTS"
  3.  
  4. Set Db = OpenDatabase(Dbpath & DbName)

Any input will be greatly appreciated.
Thanks.
tgif
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,146
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 132
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: VB6 - Locate/Access Database in a Server directory

 
0
  #3
Nov 17th, 2007
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.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 1580 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC