Intermittent connection issues (ASP.NET 2.0, Access 2K) RRS feed

  • Question

  • User1452931563 posted

    Hello all,

    I have an old ASP.NET 2.0 application running on a standalone Windows XP Pro machine with IIS and using Access 2000 for its database. The application has run great for several years. All of a sudden, about a month ago, we started to experience intermittent database errors.

    The database is LOCAL, not over a network. On average, 150-200 rows are added to the database daily. We will experience a connection error approximately one to three times per week. Here are the two errors:

    Unspecified error: System.Runtime.InteropServices.COMException
    Stack Trace: COMException (0x80004005) Unspecified Error

    Microsoft ODBC Microsoft Access Driver - operation must use an updateable query
    Stack Trace: Mocrosoft ODBC (0x80004005)

    Here is my connection code:

    'open connection
            Dim Connection As Object
            Connection = Server.CreateObject("ADODB.Connection")
            Connection.Open("PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("database.mdb") & ";") 'Use only virtual path here
    ' in the sendform sub
           Dim strSQL As String
            strSQL = "INSERT INTO Clients (Name"
            For i = 0 To UBound(myArray)
                strSQL = strSQL & "," & svcArray.GetValue(0, i)
            strSQL = strSQL & ") VALUES ('" & name & "'"
            For i = 0 To UBound(myArray)
                strSQL = strSQL & ", " & svcArray.GetValue(1, i)
            strSQL = strSQL & ")"

    I have googled several times, and it seems the most likely cause of this issue is 1) Network errors (doesn't apply in this case, since the database is local) and 2) access issues - I've given Everyone and the IUSR and IWAM users full control to almost every file in wwwroot, as well as every temp directory I could find, to no avail. I don't know that it's actually an access control issue since the exact same code works most of the time.

    Any ideas appreciated!

    Thursday, April 18, 2013 8:20 PM

All replies

  • User589263704 posted

    n CF, I once had an issue like what you were seeing. I had CF on 1 server, and sql 2008 r2 on another server. I would see CF errors like you posted below. To help trace it to a network error I wrote something like this:

    1) created a down.bat

    tracert serverip

    2) I then put a around the query.

    When the query generated the error I would execute

     <cfmail to="ME" from="Server" subject="SQL DOWN"> Server Debugging Info: ------------------------------------------------------------  #now()# #cfcatch.Detail# #cfcatch.Message# #log# </cfmail>

    This helped me fix my situation which ended up being hardware at the datacenter.See Also

    Sunday, April 21, 2013 12:59 PM
  • User1452931563 posted

    Hi ValBavaria,

    Thank you for your reply. What is "CF"?

    Thanks for the tip, but I am able to keep track of the error since the staff copy it into a text file each time it occurs. There was another "unspecified error" again this week. However, since the database is on the same harddrive as the application (both are on the same C drive), I can be sure it's not a network issue.

    Interesting link you provided. I should note that my database is not located in the App_Data folder. It is in the site root. I ensure that the generic web users and the "Everyone group" has access to it.

    Do you think I should move the database into an App_Data folder? it is a website app, the website is compiled, and there is no App_Data folder, but there is a bin folder?

    Wednesday, April 24, 2013 8:06 PM
  • User1452931563 posted
    Does anyone have any ideas for me?
    Wednesday, May 1, 2013 8:47 PM