Gary:
Your problem extends well beyond working on the project. What are you going
to do when you deploy the application to other computers?
The best thing to do is to keep the location of the database in the
application configuration file. If you can't use a path reference, create an
ODBC DSN entry in Administrative Tools and only store the DSN name in the
application configuration file. You will then need to create the same DSN on
all machines that will run the app.
Alternatively, (although this would only work reliably for development) you
can access the database using a relative path.
--
Sven.
"Gary Paris" <ya**@somewhereovertherainbow.com> wrote in message
news:#l**************@TK2MSFTNGP09.phx.gbl...
I am working on a project which I have on my desktop. The project and
data reside on the D: drive
Sometimes I copy the project over to the laptop which is on the C: drive.
Each time I have to edit the following code to put the proper Drive letter
in.
g_DataLocation = "D:\Test\Test.mdb"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
g_DataLocation
Is there a way that I can have the project go to the correct drive without
having to physically change the D: to C: ?
I saw a application.config file but if I copy everything, that gets
replaced also.
Thanks,
Gary