944,045 Members | Top Members by Rank

Ad:
Nov 16th, 2007
0

VB6 - Locate/Access Database in a Server directory

Expand Post »


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
Similar Threads
Reputation Points: 22
Solved Threads: 0
Junior Poster
tgifgemini is offline Offline
113 posts
since Jul 2007
Nov 16th, 2007
0

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

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
Reputation Points: 22
Solved Threads: 0
Junior Poster
tgifgemini is offline Offline
113 posts
since Jul 2007
Nov 17th, 2007
0

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

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.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Save menu in visual basic
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to create and use databases in VB





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC