If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Problem with recordset opening

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-26-04, 10:38
aderiggi aderiggi is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 03-26-04, 12:04
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Did you reconfigure ODBC for your database?
Reply With Quote
  #3 (permalink)  
Old 03-26-04, 12:06
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
What is in your file db_main.asp?
Reply With Quote
  #4 (permalink)  
Old 03-31-04, 11:28
aderiggi aderiggi is offline
Registered User
 
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;"
%>
Reply With Quote
  #5 (permalink)  
Old 03-31-04, 12:00
gyuan gyuan is offline
Registered User
 
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On