Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting

Post new topic   Reply to topic
Connecting to database using App.path
View previous topic :: View next topic  
Author Message
Mitesh2004
Freshman


Joined: 26 Jan 2004
Posts: 43

PostPosted: Feb 18th, 2004 05:53 AM    Post subject: Connecting to database using App.path Reply with quote

Hi,

I am connecting to a database using the ADO controller. At the moment, the Connection String property is a specified path. This means that this path needs to be changed everytime my system is installed on a new computer.

Can i somehow use App.path here somehow instead of specifying the whole path?

I would be very grateful for any help! Cheers!!
Back to top
View user's profile Send private message Send e-mail
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Feb 19th, 2004 12:51 AM    Post subject: Reply with quote

Yeah...when you build your connection string use ...
"dbq=" & app.path & "\Database.mdb"

Is this what your looking for? Every time the program runs it will attempt to connect to the <path>\database.mdb file

Basically, strip the connection string down to the point where you just replace the set path with:

[vb:1:217b62c60b]
" & app.path & "\
[/vb:1:217b62c60b]
_________________
If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic