|
-
May 1st, 2006, 10:37 AM
#1
Thread Starter
New Member
server.Mappath
Say i have something like this:
VB Code:
<connectionStrings>
<add name="DBConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\Prima\App_Data\DB.mdb"; providerName="System.Data.OleDb" />
</connectionStrings>
but i want to make it with relative path like this
VB Code:
<connectionStrings>
<add name="DBConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=~\App_Data\DB.mdb"; providerName="System.Data.OleDb" />
</connectionStrings>
but when i replace the path with the tilda '~' i get an error (exception) "'C:\WINDOWS\system32\~\App_Data\DB.mdb' is not a valid path...."
Thanks for the help
-
May 1st, 2006, 12:20 PM
#2
Re: server.Mappath
VB Code:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.MapPath("\Prima\App_Data\DB.mdb") & "; providerName=System.Data.OleDb"
-
May 1st, 2006, 12:34 PM
#3
Thread Starter
New Member
Re: server.Mappath
Well now i am getting warning msg from intellisense:
Missing attribute value on attribute 'server.MapPath'
VB Code:
<add name="DBConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source==" & server.MapPath("\Prima\App_Data\DB.mdb") & "; providerName="System.Data.OleDb" />
Tnx
-
May 1st, 2006, 12:43 PM
#4
Thread Starter
New Member
Re: server.Mappath
Btw, i am using VB 2005 and web.config for the purpose (if it helps at all)
-
May 1st, 2006, 12:55 PM
#5
Re: server.Mappath
Sorry I goofed that up a little, use your original config settings, then do a replace on the tilde with the information I gave you.
-
May 1st, 2006, 03:11 PM
#6
Thread Starter
New Member
Re: server.Mappath
And how finally it suppose to look like? I had a couple tries but none of them wasn't succefull. Thanks in advance
-
May 2nd, 2006, 04:27 AM
#7
Thread Starter
New Member
-
May 2nd, 2006, 01:04 PM
#8
Thread Starter
New Member
Re: server.Mappath
Nobody knows that? hah ... lol 
Whatever ... thanks for reading it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|