473,406 Members | 2,849 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,406 software developers and data experts.

how to make relative connection string

hello........

I'm developing a client software. i'm now actually using an absolute
path for my connection string in my program abd this will be a problem
when i want to deploy it into another computer.

how do i solve this?

Thank you
Nov 16 '05 #1
3 2444
Create a network share and reference it (assuming it's a desktop db). string
cn = @\\UseMSDEInstead\AccessDb.mdb; If it's a real client server db then
just use it's servername to reference it

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"mrzoab" <mr****@hotmail.com> wrote in message
news:7a*************************@posting.google.co m...
hello........

I'm developing a client software. i'm now actually using an absolute
path for my connection string in my program abd this will be a problem
when i want to deploy it into another computer.

how do i solve this?

Thank you

Nov 16 '05 #2
add an element to your config file that contains the connection string.
Refer to it in code. Then, when you deploy, you (or your users, or a small
config app) can modify the config file to point to the proper directory.

Also, consider using a relative path. e.g. assuming you are using Access,
just point to the same directory as the app is in, or a subdirectory that
you will create during installation. Doesn't matter where the user picks...
you db will always be in the same (relative) location.

--- Nick

"mrzoab" <mr****@hotmail.com> wrote in message
news:7a*************************@posting.google.co m...
hello........

I'm developing a client software. i'm now actually using an absolute
path for my connection string in my program abd this will be a problem
when i want to deploy it into another computer.

how do i solve this?

Thank you

Nov 16 '05 #3
Hi,

If you know the relative path of the DB from your app you can build the
connection string from code. Also you can create a "config" option in the
app from where the client can locate the db, just use the OpenFileDialog for
this.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"mrzoab" <mr****@hotmail.com> wrote in message
news:7a*************************@posting.google.co m...
hello........

I'm developing a client software. i'm now actually using an absolute
path for my connection string in my program abd this will be a problem
when i want to deploy it into another computer.

how do i solve this?

Thank you

Nov 16 '05 #4

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

Similar topics

2
by: RAW | last post by:
Hi Im trying to us relative path in my connection string instead of absolute what Im doing wrong this is my code Sub Page_Load() Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;"...
1
by: Prateek | last post by:
Hi, I am using appSettings in Web.Config to store my connection string. However, I am not able to provide a relative path to the Access database. How can I do that? TIA Prateek
8
by: dw | last post by:
Hello, all. I have a site that I'm testing on my LOCALHOST and also on a remote server, depending on whether I'm at work or at home. I don't want the OLEDBDATAAdapter to be pointing to the remote...
6
by: openleren | last post by:
Hi all, how can I use a relative path in my web.config file for an Access db?: Instead of using <configuration> <appSettings> <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
8
by: Daniel Serrano | last post by:
Hi, is it possible to use a relative path in a Connection string to access an Access database in a stand alone visual basic desktop application. All the examples that I have seen have absolute...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
8
by: ghadley_00 | last post by:
Hi, I have an access database with a table linked to an external text file. Occasionally the location of the database and the text file change (but are always in the same directory). Is there a...
1
by: mfreeman | last post by:
I have a VB.NET 2005 Windows application that worked fine when I ran it a month ago, and now it is throwing an exception ("The remote server returned an error: (500) Internal Server Error.") and I...
1
by: xahlee | last post by:
Elisp Tutorial: Make Google Earth Xah Lee, 2006-12 This page shows a example of writing a emacs lisp function that creates a Google Earth file, and creates a link to the file, as well a link...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.