473,395 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Working on project on 2 PC's

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
Nov 21 '05 #1
2 1145
SA
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

Nov 21 '05 #2

Just store the path in a registry key?
"Gary Paris" <ya**@somewhereovertherainbow.com> wrote in message
news:%2****************@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

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: chuliu | last post by:
I want to develop the project from my home pc and the project is originally in my office developing by a group of developers, myself included. VSS is implemented. I am running win2k pro in my...
4
by: GP | last post by:
We are facing a strange problems everything works fine when we are using the visual studio environment .But when we deploy it in the webserver the save buttons/submit buttons which has the cause...
4
by: Raghu Raman | last post by:
Hi, How can i run my project after copied from one machine. After Coping the project folder from one machine to other machine, i simply create the virtual directory with the same name as it was...
10
by: Tom | last post by:
I have created a new site, using asp.net c#. My pages contain client side validation to validate the users input. On my local machine this works fine, but when I moved my site to the test server,...
0
by: Thom | last post by:
I need a little help in understanding what is happening here. I have been playing with the dbcomm project available from gotdotnet. I try to make a setup project and fail with the following :...
2
by: Sheikko | last post by:
Working with database in C# Pocket PC Hi all, I want to develop an application that work with DB on pocket PC. I have added the DB to the project from Menu->Data->Add New Data Source. I want...
0
by: ping235 | last post by:
Recently, i am busying myself on a project that support both the Full ..NET Framework 2.0 and .NET Compact Framework 2.0, with the same set of c# code, but have different project properties and...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
12
by: Wernerh | last post by:
Hi all, got a problem that is driving me insane, have tried everything and wondering what I am missing. Have a adodc connection to a mdb. On the development PC the database reads perfectly to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.