|
-
Jul 30th, 2002, 11:51 PM
#1
Thread Starter
Addicted Member
Database in VB.net HELP!!
ok i want to have a database that stores information to be deploied with my software, the database can be accessed perfectly on the computer i designed the software on but when i install the software on a different computer ithe software can not detect the database it is in a different location or something
what i need to know is how can i make the software look in a file for the location of a database so when i install the program on a different computer they can specify were it goes but the software can find it.
also when i access it from vb.net i use the jet 3.something to access an Access database. Thanks for your help!
-
Jul 31st, 2002, 02:28 AM
#2
Member
This is something I came across a while back on a project I was working on. I think your problem might be the connection string to your database. In your OleDbConnection object there is a property called ConnectionString. The parameters of it are huge, but the one you are looking for is 'Data Source'. By default, as it seems, the path to the database is absolute, making it completely useless considering the astronomically small chances of the end user installing the program to the same absolute path as it was developed in. If you change the path to being relative then that should fix your problem.
-
Jul 31st, 2002, 09:02 AM
#3
Frenzied Member
In your connection string, the path for your DB, use the app.path method or just type @"\mydb.mdb". It will look for the DB in the immediate folder.
-
Aug 1st, 2002, 10:05 AM
#4
Thread Starter
Addicted Member
thanks for the @"/mydata.db" can i make it just @"mydatabase.db" without the / and it look in the same folder as the program running?
-
Aug 1st, 2002, 01:17 PM
#5
Frenzied Member
Yes you can do it that way too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|