title: How to correct my web config connection string for remote shared server
body: <p>I need help with my web config file and my connection string for an Access database. It worked fine on my local server but I cannot get the correct code for the remote shared Server path
  in my web.config file and/or my web page. </p>
  
  <p>I understand that I cannot use "Serve Map Path" in the config file so I have used a 2 part code (Web Config file and script in the head section of my "Webform1".  The database is in an App_Data folder off of the root.  The website pages are in a directory named "fsi"</p>
  
  <p>My Code WebForm1:</p>
  
  <pre><code>&lt;script&gt;
      sub Page_Load
      dim dbconn
      dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
      data source=" &amp; server.mappath(App_Data/"NewBase2.accdb"))
      dbconn.Open()
      end sub
   &lt;/script&gt;
  </code></pre>
  
  <p>My Code in Web.Config:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;system.web&gt;
      &lt;customErrors mode="Off"/&gt;
    &lt;/system.web&gt;
  
    &lt;connectionStrings&gt;
  
       &lt;add name="ConnectionString1" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
        Source=\App_Data\NewBase2.accdb" providerName="System.Data.OleDb" /&gt;
  
    &lt;/connectionStrings&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>For this the error message is</p>
  
  <pre><code>c:\App_Data\NewBase2.accdb`' is not a valid path
  </code></pre>
  
  <p>I have tried several variations of the Data Source in the config file such as changing the Data Source to {0} resulting in the error message:
  I have tried several variations of the Data Source in the config file such as changing the Data Source to {0} resulting in the error message </p>
  
  <pre><code>'c:\windows\system32\inetsrv\{0}`
  </code></pre>
  
  <p>I have read all of the threads on this site related to this topic and have tried many suggestions but I am still getting error messages, primarily that path is invalid.
  How should I code these two parts to get them to work correctly? </p>
  
  <p>Thank-you to anyone who can help with this,
  Psy51</p>