Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: Problem with recordset opening

    I am having an issue where i have a asp page connecting to a database being successful on the first connect but failing on any attempt after that.

    The following is the message I get:
    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    Unspecified error
    /Test1.asp, line 13



    The following is the code I use:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/db_main.asp" -->
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_db_main_STRING
    Recordset1.Source = "SELECT * FROM informix.xx_rec WHERE id=1"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <table width="75%" border="1">
    <tr>
    <th>ID</th>
    <th>NAME</th>
    <th>SSN</th>
    </tr>
    <tr>
    <td><%=(Recordset1.Fields.Item("id").Value)%></td>
    <td><%=(Recordset1.Fields.Item("fullname").Value)% ></td>
    <td><%=(Recordset1.Fields.Item("ss_no").Value)%> </td>
    </tr>
    </table>

    </body>
    </html>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>


    The error seems to be occurring on the Recordset1.Open() line of code.

    Any help would be greatly appreciated

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    Did you reconfigure ODBC for your database?

  3. #3
    Join Date
    Dec 2003
    Posts
    454
    What is in your file db_main.asp?

  4. #4
    Join Date
    Mar 2004
    Posts
    2
    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' DesigntimeType="ADO"
    ' HTTP="false"
    ' Catalog=""
    ' Schema=""
    ' Connection Lifetime=0
    Dim MM_db_xxx_STRING
    MM_db_cars_STRING = "dsn=openlink;uid=xxxxx;pwd=xxxxx;"
    %>

  5. #5
    Join Date
    Dec 2003
    Posts
    454
    Are you using MS SQL or Access? Did you set DSN through ODBC? If yes, did you try to reconfigure it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •