473,626 Members | 3,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trying to us RELATIVE PATH ON MY CONNECTION STRIN

RAW
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=Micro soft.Jet.OLEDB. 4.0;" strConnection += "Data
Source=Server.M apPath("../dbcontainer/content.mdb") data_src.text =
strConnection
Nov 18 '05 #1
2 1533
What is the exception and what does server.mapppath return?

This by the way is not a good idea to build a connection string because you
will not be taking adantage of the connection pooling in the framework.
Connection pooling uses a exact match algorithm. Most times, building
strings does not result in a exact match.

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RAW" <de****@terra.c om> wrote in message
news:ur******** ******@TK2MSFTN GP12.phx.gbl...
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=Micro soft.Jet.OLEDB. 4.0;" strConnection += "Data
Source=Server.M apPath("../dbcontainer/content.mdb") data_src.text =
strConnection

Nov 18 '05 #2
RAW
simple questions
with a simple answers

relative connection
Dim strConnection as String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source="& _ 'Server.MapPath ("../NEWMGS/dbcontainer/content.mdb")

Absolute connection
Dim strConnection as String = "Provider=Micro soft.Jet.OLEDB. 4.0; Data
Source=D:\works \WEBS\NEWMGS\db container\conte nt.mdb" DIM setNiveles AS
INTEGER DIM setContenido AS STRING DIM setPagina AS STRING

"Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
message news:ep******** ******@TK2MSFTN GP09.phx.gbl...
What is the exception and what does server.mapppath return?

This by the way is not a good idea to build a connection string because you will not be taking adantage of the connection pooling in the framework.
Connection pooling uses a exact match algorithm. Most times, building
strings does not result in a exact match.

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RAW" <de****@terra.c om> wrote in message
news:ur******** ******@TK2MSFTN GP12.phx.gbl...
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=Micro soft.Jet.OLEDB. 4.0;" strConnection += "Data
Source=Server.M apPath("../dbcontainer/content.mdb") data_src.text =
strConnection


Nov 18 '05 #3

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

Similar topics

7
78631
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
9014
by: handlim | last post by:
I am trying to make some program with XML in class library by C#. I read XML file in my program by using oXmlDoc.Load(xmlfilename); But, It occured error... It read from C:\windows\system32,,, But my XML file is in same directory with my program. So, I know I have to use relative path.... Who knows how to get relative path in class library? Is there anyone who know this solution... Please,,,Help me,,,,
1
5350
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
1957
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
11759
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" /> ...
4
7846
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is injected. If I specify a document-relative path (e.g., src="../someFolder/AnotherFolder/TheGraphic.gif"), then it works fine, but only for documents that exist at the level in the directory structure. I thought I could use a root-relative...
1
1267
by: Martin Williams | last post by:
Are there examples of this for connecting to an access database? Thanks to Cor for trying to answer my question earlier, but I think I phrased it wrong. Regards, Martin Williams
1
2349
by: Anees | last post by:
hi i was trying to implement mode rewrite option in a blog site. i used the lines for listing the posts by its topic category as #List by Category RewriteRule ^Topics/(+)$ index.php?cat=$1 #With page navigation option RewriteRule ^Topics/(+)/(*)$ index.php?cat=$1&start=$2
1
6794
by: desturrr | last post by:
I am having diffuculties while trying to make the path of my files relative. I am using an interface to hold my static variables in order not to mix them with my other codes , just implementing the interface is sufficient to use the variables. I need to give the address of my file as a parameter, and i am making it by using absolute path of file just like below . >>static JLayerPlayer xLayer=new...
0
8199
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
8638
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...
0
7196
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
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
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
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
2626
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
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
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.