Database Connection strings in web.config

Discussion in 'ASP.NET / ASP.NET Core' started by Takeshi Eto, Sep 11, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Takeshi Eto

    Takeshi Eto DiscountASP.NET Staff

    You can find the full server path in the Account Information of your control panel.

    DiscountASP.NET
    http://www.DiscountASP.NET
     
  2. I like to use web.config files for database connection strings
    However I'm not sure how to access my database on discountasp:

    Provider=Microsoft.Jet.OLEDB.4.0;Data source=D:\Inetpub\WWWroot\03Fall\hallo\database\MusicStore.mdb;
    </font id="limegreen">
    worked when my site was hosted on another server but I'm not sure
    </font id="brown">

    Owen
     
  3. So let me get this straight the path would be like
    e:\web\infinitedes\htdocs\_database\MusicStore.mdb


    Owen
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    if your database is in the _database directory.

    quote:Originally posted by infinitedes

    So let me get this straight the path would be like
    e:\web\infinitedes\htdocs\_database\MusicStore.mdb


    Owen
    </blockquote id="quote"></font id="quote">

    B.

    DiscountASP.NET
    http://www.DiscountASP.NET
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    Add this line

    myConn.open

    after this

    myConn = New OleDbConnection (DSN)

    quote:Originally posted by infinitedes

    I got an error when I tried using the physical path as suggested:
    Here is the code to my configuration file to connect to the database
     
  6. I got an error when I tried using the physical path as suggested:
    Here is the code to my configuration file to connect to the database
     
  7. OK that problem is fixed but now I have another problem:


    Unrecognized database format 'e:\web\infinitedes\htdocs\_database\MusicStore.mdb'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.OleDb.OleDbException: Unrecognized database format 'e:\web\infinitedes\htdocs\_database\MusicStore.mdb'.

    Source Error:

     
  8. Bruce

    Bruce DiscountASP.NET Staff

    2 possible problems associated with this error

    1) The database file is corrupted during upload (yes. this happens sometime with access).

    Try download the db back to your computer and try open it with Access

    2) The DB is created with an older version of MS Access.


    quote:Originally posted by infinitedes

    OK that problem is fixed but now I have another problem:


    Unrecognized database format 'e:\web\infinitedes\htdocs\_database\MusicStore.mdb'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.OleDb.OleDbException: Unrecognized database format 'e:\web\infinitedes\htdocs\_database\MusicStore.mdb'.

    Source Error:

     
  9. Thank you very much for all you help I will try it. I post the outcome .

    Dillon.
     
  10. fyz

    fyz

    Hi, </o:p>
    </o:p>
    I had similiar problems several days ago, and it turned out to be my mdb file's corruption. Ifinally tired a utility called Advanced Access Repair to repair my Access MDB file. It works rather well for me.Hope this can help in the future.</o:p>
    </o:p>
    Alan</o:p>
     
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