upstreamaccess
01-10-2007, 03:40 AM
Hello, I've about given up trying to figure this out on my own. Please help.
How do I avoid this error when there is no matching record.
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
I've stripped down the code in my page to the bare minimum for your review. When there is a matching record, it comes up. When there isn't, I can't get past the error. I am not passing URL info but simply opening a page and expect the record set to come up blank when there isn't a match.
Here is the code. Thank you enormously for helping me past this.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ProjexDB.asp" -->
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_ProjexDB_STRING
Recordset1_cmd.CommandText = "SELECT * FROM Status WHERE Customer = 'Trident Formulas'"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<%=(Recordset1.Fields.Item("Customer").Value)%>
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
How do I avoid this error when there is no matching record.
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
I've stripped down the code in my page to the bare minimum for your review. When there is a matching record, it comes up. When there isn't, I can't get past the error. I am not passing URL info but simply opening a page and expect the record set to come up blank when there isn't a match.
Here is the code. Thank you enormously for helping me past this.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ProjexDB.asp" -->
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_ProjexDB_STRING
Recordset1_cmd.CommandText = "SELECT * FROM Status WHERE Customer = 'Trident Formulas'"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<%=(Recordset1.Fields.Item("Customer").Value)%>
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>