« Previous Next »

Thread: Error when when checking db connection with Classic ASP, Access and IIS7

Last post 03-29-2008 1:02 AM by qbernard. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 03-25-2008, 7:28 PM

    Error when when checking db connection with Classic ASP, Access and IIS7

    I have a site that I moved from a Windows 2003 Server to a Server 2008.  This site uses a CMS portal system.  In the config routine it verifies the db connection and will only load if there are no errors.  I am getting the error:

    "-2147217887 : Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."

    I have already tried the solutions provided here: http://forums.iis.net/t/1091950.aspx.  As well as everything else I have found searching these forums, MS support, and elsewhere.

    Now for the part that has really given me trouble trying to solve the problem.  I have created two pages to isolate the issue, one with the error check and one without.

    ------------------------------------------------------------------------

    <!-- #include file="includes/inc_ADOVBS.asp" -->
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>

    <%
    Dim strDBPath, strConnString, my_Conn, rs

    strDBPath = Server.MapPath("******/******.mdb")
    strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath

    on error Resume Next
    Set my_Conn = Server.CreateObject("ADODB.Connection")
    my_Conn.Errors.Clear
    my_Conn.Open strConnString

    If my_conn.Errors.Count <> 0 Then
        For counter = 0 To my_conn.Errors.Count -1
            ConnErrorNumber = my_conn.Errors(counter).Number
            ConnErrorDesc = my_conn.Errors(counter).Description
            If ConnErrorNumber <> 0 Then
                strtemp = "<p>" & ConnErrorNumber & " : " & ConnErrorDesc & "</p>"
            End If
       Next
       my_conn.Errors.Clear

       Set my_Conn = Nothing
       on error goto 0
       Response.Write strtemp
    End If
    %>
    </body>
    </html>

    ------------------------------------------------------------------------

    <!-- #include file="includes/inc_ADOVBS.asp" -->
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>

    <%
    Dim strDBPath, strConnString, my_Conn, rs

    strDBPath = Server.MapPath("******/******.mdb")
    strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath

    set my_Conn = Server.CreateObject("ADODB.Connection")
    my_Conn.Open strConnString

    Set rs = my_Conn.Execute ("SELECT * FROM PORTAL_MEMBERS WHERE MEMBER_ID=1;")
    OrigName = rs.fields("m_username")
    response.write "<p>Original Username = " & OrigName & "</p>"

    Set rs = my_Conn.Execute ("UPDATE PORTAL_MEMBERS SET m_username='BadName' WHERE MEMBER_ID=1;")
    Set rs = my_Conn.Execute ("SELECT * FROM PORTAL_MEMBERS WHERE MEMBER_ID=1;")
    response.write "<p>New Username = " & rs.fields("m_username")& "</p>"

    Set rs = my_Conn.Execute ("UPDATE PORTAL_MEMBERS SET m_username='" & OrigName & "' WHERE MEMBER_ID=1;")
    Set rs = my_Conn.Execute ("SELECT * FROM PORTAL_MEMBERS WHERE MEMBER_ID=1;")
    response.write "<p>Reset Username = " & rs.fields("m_username")& "</p>"

    set my_Conn = nothing

    %>
    </body>
    </html>

    ------------------------------------------------------------------------

    The first page gives the error, the second page runs with no trouble.  Obviously I can connect to the db, and have permissions to make changes, but then why do I get the error in the other routine.  I have tried to remove the error check from the CMS portal, but then it fails elsewhere.  I feel that if I can get this issue resolved, the rest of the portal should probably work as well.

  • 03-26-2008, 11:24 PM In reply to

    Re: Error when when checking db connection with Classic ASP, Access and IIS7

    what's the current error msgs ? still 8004005 ?

    Cheers,
    Bernard Cheah
  • 03-27-2008, 11:06 AM In reply to

    Re: Error when when checking db connection with Classic ASP, Access and IIS7

    Has never been that, the error message is: 

    "-2147217887 : Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."

    I am documenting my testing at http://www.superiorinteriors.biz/ztest.asp.  I have included a third page the checks the connection, displays the error, and then goes on despite the error.  This is OK in my testing, but I am really looking for the cause, not just a workaround.  This is my first Server 2008, and I need to know what is going on as more 2008 systems are deployed.

  • 03-29-2008, 1:02 AM In reply to

    Re: Error when when checking db connection with Classic ASP, Access and IIS7

Page 1 of 1 (4 items)
Microsoft Communities