PDA

View Full Version : database path in vb.net windows application


Alison Forezli
06-15-04, 01:00 AM
Here we go:
I have developed (for a company) a VB.net application that uses an MS Access database. Currently, I have the database in my "C:" drive and am hard coding the path in my application to access it.

However, what do I use as a path so that I can create an installment package to install this application in the company's computer?
Also, this company has a server and I am wondering if the database should go on the server and then what path would I use in the application?

Sorry for sounding clueless, but I am new to this type of thing. :) :) :) :)

I would GREATLY APPRECIATE INPUT!!!!!!!!!!!!!!!
Thanks.
- A.F.

chirag
06-17-04, 03:06 AM
Hi,

You should create your application folder and may be db folder in that.
Put your mdb file in db folder of your application.
Use relative path in your code.
While creating package add your mdb file to the list of files to be copied and make sure installation path is same as your folder structure.

So, no matter on which machine you install your application your relative path will not change.( i.e. one level down to your application directory )


I think this should work fine.