473,765 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2460
Create a network share and reference it (assuming it's a desktop db). string
cn = @\\UseMSDEInste ad\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.goog le.com...
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.goog le.com...
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.goog le.com...
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
1540
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;" strConnection += "Data Source=Server.MapPath("../dbcontainer/content.mdb") data_src.text = strConnection
1
5361
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
1966
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 Access db, but to the local one. The OLEDBDATAAdapter wizard puts the entire path of the db (\\myserver\.... or c:\myprojects\....). The db resides within the site's folders; is there anyway to use relative paths for it (something like...
6
11773
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 source=c:/Inetpub/MyApp/data/database.mdb" /> ...
8
3455
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 paths but my application could be a lot more flexible if it didn't depend on this. Thanks, Daniel Serrano
6
4900
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
8
28525
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 way to have the location of the external text file be a relative, rather than absolute path (to be .\textfile.txt rather than C:\dir\textfile.txt)? Any advice that can be provided would be provided would be greatly appreciated/
1
4716
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 don't know why. The application screen scrapes a web page. If I paste the URL in my browser's address bar and the expected page comes up just fine. When I went through the hassle of getting the real response from within the exception object,...
1
7290
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 to Google Map. If you don't know elisp, first take a gander at Elisp Basics. I often write travelogs on my website. If i traveled to Las Vegas, then
0
9399
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9957
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.