When using the Data Adapter Configuration Wizard on my local server I
successfully make a "New Connection" after pointing it to the Access MDB
file on my local file system. But when I try to duplicate this on my live
web server I can't figure out what to put in for the path to my database.
Can I use the wizard or do I have to build the OleDbConnection's DataSource
string manually as my web page loads?
Live site is hosted at Microsoft bCentral
You should set OleDbConnection.ConnectionString properly - you might store
the connection string in web.config file and read it:
web.config:
<?xml version="1.0" encoding="windows-1250"?>
<configuration>
...
<appSettings>
...
<add key="YourStringKey" value="connection string"/>
....
< /appSettings>
...
</configuration>
Code:
oleDbConnection.ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings["YourStringKey"];
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
"Jim Brown" <j...@applicationsplus.com> wrote in message
news:%23ElxqR7...@TK2MSFTNGP11.phx.gbl...
Maxim
[www.ipattern.com do you?]
"Jim Brown" <j...@applicationsplus.com> wrote in message
news:%23ElxqR7...@TK2MSFTNGP11.phx.gbl...
I was able to use the Server.Mathpath function to determine the actual
path to my live web server. I hard coded that in the web.config's copy
of the key noted above and all seems to work.
I wound up with this (except that 111.222.333.444 is not the actual IP
address):
\\111.222.333.444\files6\191\applicationsplus.com\web\dotnet\vbtest\db\webdata.mdb
Everything after the \applicationsplus.com makes sense to me as that's
the folder paths in my site. I'm sure that the pieces before could
change if my web host moves my site to another of their servers. So my
next question: is there a better way of coding this into the
web.config file?
I was able to use the Server.Mathpath function to determine the actual path
to my live web server. I hard coded that in the web.config's copy of the key
noted above and all seems to work.
I wound up with this (except that 111.222.333.444 is not the actual IP
address):
\\111.222.333.444\files6\191\applicationsplus.com\web\dotnet\vbtest\db\webda
ta.mdb
Everything after the \applicationsplus.com makes sense to me as that's the
folder paths in my site. I'm sure that the pieces before could change if my
web host moves my site to another of their servers. So my next question: is
there a better way of coding this into the web.config file?
"Maxim V. Karpov" <m...@ipattern.com> wrote in message
news:uxn2aRA6...@tk2msftngp13.phx.gbl...