problem with deleting object...?

M

Mikael Hellström

Hi.,
I get this error when i am trying to close my object after this operation!
What can be wrong?
Regards Mikael

Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.

My code

<%@ Language=VBScript%>
<!-- #include file ="./connectionStr\conStr.inc" -->
<%
if isEmpty(session("medlemsNr")) then
response.redirect("./somepage.asp")
end if

Response.buffer=true
Response.ExpiresAbsolute = Now()
Response.AddHeader "Cache-Control", "private"
session("last_move")=time()
'--------------------------------------------------------------
Dim objConn ' ADO Recordset Object
Dim objRS ' ADO Connection Object
Dim strSQL
'--------------------------------------------------------------
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString=connectionStr
objConn.Open
'--------------------------------------------------------------
Set objRS = Server.CreateObject("ADODB.Recordset")

strSQL="delete from rosor where id=" & request.QueryString("id")
objRS.Open strSQL, objConn

objRS.Close
Set objRS = Nothing

objConn.Close
Set objConn = Nothing
str="./rosor.asp?medlemsNr=" & request.QueryString("medlemsNr")

response.Redirect(str)

%>
 
B

Bob Barrows

Mikael said:
Hi.,
I get this error when i am trying to close my object after this
operation! What can be wrong?
Regards Mikael

Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
strSQL="delete from rosor where id=" & request.QueryString("id")
objRS.Open strSQL, objConn

Don't use a recordset when you are not retrieving records!!!!

objConn.Execute strSQL..129

The 129 tells ADO that you are using a command of type "text" and it does
not return records.

HTH,
Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top