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

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=Microsoft.Jet.OLEDB.4.0;" strConnection += "Data
Source=Server.MapPath("../dbcontainer/content.mdb") data_src.text =
strConnection
Nov 18 '05 #1
2 1520
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.com> wrote in message
news:ur**************@TK2MSFTNGP12.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=Microsoft.Jet.OLEDB.4.0;" strConnection += "Data
Source=Server.MapPath("../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=Microsoft.Jet.OLEDB.4.0; Data
Source="& _ 'Server.MapPath("../NEWMGS/dbcontainer/content.mdb")

Absolute connection
Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=D:\works\WEBS\NEWMGS\dbcontainer\content.md b" 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**************@TK2MSFTNGP09.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.com> wrote in message
news:ur**************@TK2MSFTNGP12.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=Microsoft.Jet.OLEDB.4.0;" strConnection += "Data
Source=Server.MapPath("../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
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
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...
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...
4
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...
1
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
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 ...
1
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.