Cannot Write To Access Database

Discussion in 'Databases' started by nh_capricorn, Sep 3, 2004.

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 an Access database located under /htdocs/_database. I also have a Web Services application, located at /htdocs/AppName. For some reason, I cannot write to the database. The original code worked on my local PC, but it does not work when I upload the program to the site. Is there something I'm missing? What about the relative path (what is it)?

    This is the code I'm using to try and connect:

    OleDbConnection conn = new OleDbConnection (
    "Provider=Microsoft.Jet.OleDb.4.0; Data Source=" +
    Server.MapPath( "\htdocs\_database/Test.mdb" ) );

    I also tried using a fully-qualified path, but that didn't work either:

    string dir = "e:\\web\\smarttech\\htdocs\\_database\\test.mdb";
    OleDbConnection conn = new OleDbConnection();
    conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
    @"Data source="+dir+"test.mdb";

    Any help would be greatly appreciated.
     
  2. Try this for the connection string:
    Provider=Microsoft.Jet.OleDb.4.0; Data Source="e:\web\smarttech\htdocs\_database\test.mdb";
     
  3. Thanks Scott! That worked just fine.
     
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