Help with connection string ?

Discussion in 'ASP.NET / ASP.NET Core' started by Qscomics, Jun 24, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have the following connection string which comes up with an error message :

    <%
    strMDBpath = Server.MapPath("access_db/Quicksilver1.mdb")
    MM_connQuicksilver1_STRING = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&strMDBPath&"; Jet OLEDB:Database Password=qs_db116;"
    'MM_connQuicksilver1_STRING = "dsn=Quicksilver1;"
    %>

    the error message I get is :

    Microsoft JET Database Engine error '80004005'

    'd:\hosting\qsco6606\qs_db116\Quicksilver1.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

    /amendacc2.asp, line 202

    The file amendacc2.asp, line 202 reads :

    rsCountries.ActiveConnection = MM_connQuicksilver1_STRING

    I've been trying to figure this out for days with no luck. I can't understand why the error message reads hosting\qsco6606\qs_db116\Quicksilver1.mdb
    when the qs_db116 was the folder the DBs were previously stored in, but now they are stored in a folder called access_db.
    Whatever I change in the connection string makes no difference - I'm stumped.
     
  2. Put it in the App_Data folder and do it like this:
    (With your version of Access of course)

    <connectionStrings>
    <clear />
    connectionString="Provider=Microsoft.ACE.OleDb.12.0;Data Source=|DataDirectory|access.accdb" providerName="System.Data.OleDb" />
    </connectionStrings>
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    are you hosting this site with DiscountASP.NET or somewhere else? the path information doesn't look right.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page