trying to us RELATIVE PATH ON MY CONNECTION STRIN

R

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
 
A

Alvin Bruney

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
 
R

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.mdb" DIM setNiveles AS
INTEGER DIM setContenido AS STRING DIM setPagina AS STRING
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top