Error with ASP.NET opening OleDb/ODBC database

Discussion in 'ASP .Net' started by Giuseppe D'Elia, Jul 15, 2003.

  1. Hi there,

    I got a problem using an MS Access database through
    ASP.NET.

    After updating my system from .NET Framework 1.0 to 1.1,
    my existing
    application gives me the following error when opening a
    connection
    with the code below:

    "Unspecified error" (ErrorCode: -2147467259)

    string connectionStringKey = "LocalDBConnectionString";
    string connectionString
    = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";

    OdbcConnection connection = new OdbcConnection
    (connectionString);
    try
    {
    connection.Open();
    }
    catch (OdbcException ex)
    {
    string error = ex.Message;
    }
    finally
    {
    connection.Close();
    }

    What's really strange is that:
    1. The same application works on some of my colleagues'
    computers with
    the .net Framework 1.1
    2. The very same code works on my computer when creating a
    brand new
    application with VS.NET 2003
    3. The same application was working with .NET Framework 1.0

    The same thing happens (including the two cases above)
    when using ODBC
    classes instead of OleDB ones. In this case the connection
    string is:

    "FIL=MS Access;DSN=AIS_Local"

    and the error is:

    "ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    Disk or
    network error.\r\nERROR [IM006] [Microsoft][ODBC Driver
    Manager]
    Driver's SQLSetConnectAttr failed\r\nERROR [HY000]
    [Microsoft][ODBC
    Microsoft Access Driver] Disk or network error."

    Need HELP!!!
    tks
     
    Giuseppe D'Elia, Jul 15, 2003
    #1
    1. Advertising

  2. Giuseppe D'Elia

    Peter Guest

    Just to help with a little more info on what might be the
    same problem.

    http://www.asp.net/Forums/ShowPost.aspx?
    tabindex=1&PostID=225749

    I have the same problem that I can't access my mdb.
    I have enabled p/w on my db but this does not seem to work
    for me.

    If you solve the problem please post the solution.

    Peter

    >-----Original Message-----
    >Hi there,
    >
    >I got a problem using an MS Access database through
    >ASP.NET.
    >
    >After updating my system from .NET Framework 1.0 to 1.1,
    >my existing
    >application gives me the following error when opening a
    >connection
    >with the code below:
    >
    >"Unspecified error" (ErrorCode: -2147467259)
    >
    >string connectionStringKey = "LocalDBConnectionString";
    >string connectionString
    >= "Provider=Microsoft.Jet.OLEDB.4.0;Data
    >Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";
    >
    >OdbcConnection connection = new OdbcConnection
    >(connectionString);
    >try
    >{
    >connection.Open();
    >}
    >catch (OdbcException ex)
    >{
    >string error = ex.Message;
    >}
    >finally
    >{
    >connection.Close();
    >}
    >
    >What's really strange is that:
    >1. The same application works on some of my colleagues'
    >computers with
    >the .net Framework 1.1
    >2. The very same code works on my computer when creating

    a
    >brand new
    >application with VS.NET 2003
    >3. The same application was working with .NET Framework

    1.0
    >
    >The same thing happens (including the two cases above)
    >when using ODBC
    >classes instead of OleDB ones. In this case the

    connection
    >string is:
    >
    >"FIL=MS Access;DSN=AIS_Local"
    >
    >and the error is:
    >
    >"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    >Disk or
    >network error.\r\nERROR [IM006] [Microsoft][ODBC Driver
    >Manager]
    >Driver's SQLSetConnectAttr failed\r\nERROR [HY000]
    >[Microsoft][ODBC
    >Microsoft Access Driver] Disk or network error."
    >
    >Need HELP!!!
    >tks
    >.
    >
     
    Peter, Jul 24, 2003
    #2
    1. Advertising

  3. Giuseppe D'Elia

    John Toop Guest

    Hi Peter, I had a similar problem with MSAccess. It was becasuse the ASPNET
    user (it seems this is the user that ASP.NET uses) did not have permissions
    to read/write ... in the directory I had chosen to place the file. I moved
    it into it's own directory and changed the permission to allow ASPNET to do
    anything and ... it worked.

    I'm using an XP machine. When I clicked on the properties for the folder,
    there was no security property. I had to change "folder options" in control
    panel away from "simple security" so that I could make this change. Then
    after I had it working, I changed "folder options" back to simple security
    and it's still working.

    That was what I did for my PC. Not necessarily the solution for you.

    "Peter" <> wrote in message
    news:0b7801c351db$c9aa8870$...
    > Just to help with a little more info on what might be the
    > same problem.
    >
    > http://www.asp.net/Forums/ShowPost.aspx?
    > tabindex=1&PostID=225749
    >
    > I have the same problem that I can't access my mdb.
    > I have enabled p/w on my db but this does not seem to work
    > for me.
    >
    > If you solve the problem please post the solution.
    >
    > Peter
    >
    > >-----Original Message-----
    > >Hi there,
    > >
    > >I got a problem using an MS Access database through
    > >ASP.NET.
    > >
    > >After updating my system from .NET Framework 1.0 to 1.1,
    > >my existing
    > >application gives me the following error when opening a
    > >connection
    > >with the code below:
    > >
    > >"Unspecified error" (ErrorCode: -2147467259)
    > >
    > >string connectionStringKey = "LocalDBConnectionString";
    > >string connectionString
    > >= "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > >Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";
    > >
    > >OdbcConnection connection = new OdbcConnection
    > >(connectionString);
    > >try
    > >{
    > >connection.Open();
    > >}
    > >catch (OdbcException ex)
    > >{
    > >string error = ex.Message;
    > >}
    > >finally
    > >{
    > >connection.Close();
    > >}
    > >
    > >What's really strange is that:
    > >1. The same application works on some of my colleagues'
    > >computers with
    > >the .net Framework 1.1
    > >2. The very same code works on my computer when creating

    > a
    > >brand new
    > >application with VS.NET 2003
    > >3. The same application was working with .NET Framework

    > 1.0
    > >
    > >The same thing happens (including the two cases above)
    > >when using ODBC
    > >classes instead of OleDB ones. In this case the

    > connection
    > >string is:
    > >
    > >"FIL=MS Access;DSN=AIS_Local"
    > >
    > >and the error is:
    > >
    > >"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    > >Disk or
    > >network error.\r\nERROR [IM006] [Microsoft][ODBC Driver
    > >Manager]
    > >Driver's SQLSetConnectAttr failed\r\nERROR [HY000]
    > >[Microsoft][ODBC
    > >Microsoft Access Driver] Disk or network error."
    > >
    > >Need HELP!!!
    > >tks
    > >.
    > >
     
    John Toop, Jul 25, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mathew Vording

    asp.net ms-access oledb connection open error

    Mathew Vording, Aug 15, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,181
    Mathew Vording
    Aug 15, 2003
  2. Louise Hadley

    OLEDB database connection from ASP.NET

    Louise Hadley, Apr 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    7,533
    Louise Hadley
    Apr 17, 2004
  3. Manuel Arroba
    Replies:
    0
    Views:
    2,080
    Manuel Arroba
    Jun 28, 2004
  4. =?Utf-8?B?cGV0cm8=?=
    Replies:
    5
    Views:
    4,392
    =?Utf-8?B?cGV0cm8=?=
    Nov 21, 2005
  5. JeffP@Laptop

    dBase VFP OleDb or ODBC Drivers

    JeffP@Laptop, Jan 25, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,785
    JeffP@Laptop
    Jan 25, 2006
Loading...

Share This Page