Guest_imported
New member
- Jan 1, 1970
- 0
I am sure someone must have run into this problem.
When I run the code in SQL Server, it works.
However, it tells me that no records is found which is not true.
I have a code that inserts records into my oracle and sql server dbs, depending on which database I am using.
So part of the record that are inserted I am trying to retrieve with this code.
Like I said, in sql server, it runs the code without error but tells me no record found.
In Oracle, it just gives me this error:
"unable to perform operation when object is closed".
I used a commit in my stored proc just in case it is not finding any records in the database.
Please help!!!
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/mydb/GetSubmitResult.asp, line 51
which is this code:
<% If Not objRs.EOF And objRs.BOF Then
While not objRs.Eof %>
Here is the rest of the code:
<% Language=VBScript %>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual
Studio 6.0">
</head>
<body>
<%
const ArraySep = ","
Dim objConn,objCmd,objRS
Set objConn =server.CreateObject("ADODB.Connection"
Set objCmd= server.CreateObject("ADODB.Command"
Set objRs=server.CreateObject("ADODB.Recordset"
objConn.CursorLocation = 3
objConn.Open "DSN=mydb;UID=scott;PWD=tiger"
objRs.CursorLocation = 3
objRs.CursorType = 3
objRs.LockType = 4
dim StRaData , StData
StRaData = Request.Form("txtData"
& ArraySep
StData = Split(straData, ArraySep )
With objCmd
.CommandType = &H0004
.ActiveConnection = objConn
.CommandText = "stp_TEST_GetCV"
.Parameters.Append .CreateParameter("P_FirstName",200, &H0003, 20, stData(0))
.Parameters.Append .CreateParameter("P_LastName",200, &H0003, 20, stData(1))
.Parameters.Append .CreateParameter("P_Phone", 200,&H0003, 20, stData(2))
End With
objRs.Open objCmd
%>
<TABLE cellSpacing=0 cellPadding=10 width="58%"
border=1
align="center">
<TR>
<TD align=middle>
CV Search Result
</TD></TR>
<TR>
<% If Not objRs.EOF And objRs.BOF Then
While not objRs.Eof %>
<TR><TD><%= objRs.Fields(1).value%></TD></TR>
<TR><TD><%= objRs.Fields(2).value%></TD></TR>
<TR><TD><%= objRs.Fields(3).value%></TD></TR>
<TR><TD><%= objRs.Fields(4).value%></TD></TR>
<% obRs.moveNext
Wend
else
response.write stData(0) & stData(1) & stData(2) %>
<TR><TD> No Records Found...</TD></TR>
<% end if
Set objCmd=nothing
objRs.close
Set objRs=nothing
Set Conn = nothing
%>
</TR>
</TABLE>
</body>
</html>
When I run the code in SQL Server, it works.
However, it tells me that no records is found which is not true.
I have a code that inserts records into my oracle and sql server dbs, depending on which database I am using.
So part of the record that are inserted I am trying to retrieve with this code.
Like I said, in sql server, it runs the code without error but tells me no record found.
In Oracle, it just gives me this error:
"unable to perform operation when object is closed".
I used a commit in my stored proc just in case it is not finding any records in the database.
Please help!!!
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/mydb/GetSubmitResult.asp, line 51
which is this code:
<% If Not objRs.EOF And objRs.BOF Then
While not objRs.Eof %>
Here is the rest of the code:
<% Language=VBScript %>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual
Studio 6.0">
</head>
<body>
<%
const ArraySep = ","
Dim objConn,objCmd,objRS
Set objConn =server.CreateObject("ADODB.Connection"
Set objCmd= server.CreateObject("ADODB.Command"
Set objRs=server.CreateObject("ADODB.Recordset"
objConn.CursorLocation = 3
objConn.Open "DSN=mydb;UID=scott;PWD=tiger"
objRs.CursorLocation = 3
objRs.CursorType = 3
objRs.LockType = 4
dim StRaData , StData
StRaData = Request.Form("txtData"
StData = Split(straData, ArraySep )
With objCmd
.CommandType = &H0004
.ActiveConnection = objConn
.CommandText = "stp_TEST_GetCV"
.Parameters.Append .CreateParameter("P_FirstName",200, &H0003, 20, stData(0))
.Parameters.Append .CreateParameter("P_LastName",200, &H0003, 20, stData(1))
.Parameters.Append .CreateParameter("P_Phone", 200,&H0003, 20, stData(2))
End With
objRs.Open objCmd
%>
<TABLE cellSpacing=0 cellPadding=10 width="58%"
border=1
align="center">
<TR>
<TD align=middle>
CV Search Result
</TD></TR>
<TR>
<% If Not objRs.EOF And objRs.BOF Then
While not objRs.Eof %>
<TR><TD><%= objRs.Fields(1).value%></TD></TR>
<TR><TD><%= objRs.Fields(2).value%></TD></TR>
<TR><TD><%= objRs.Fields(3).value%></TD></TR>
<TR><TD><%= objRs.Fields(4).value%></TD></TR>
<% obRs.moveNext
Wend
else
response.write stData(0) & stData(1) & stData(2) %>
<TR><TD> No Records Found...</TD></TR>
<% end if
Set objCmd=nothing
objRs.close
Set objRs=nothing
Set Conn = nothing
%>
</TR>
</TABLE>
</body>
</html>