...

View Full Version : "Operation is not allowed when the object is closed" Error



Grayscale
03-29-2006, 02:49 PM
Hi everyone,

When I try to execute the code below in asp I get the following error
message:

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

Rs.Open "SELECT COUNT(KartNo) From Personel WHERE
KartNo="&kayit3&"", Con, 3,3
While Not Rs.Eof
if RS(0) = 0 Then
Set Rs = Con.Execute ("INSERT INTO Personel (Adi, Soyadi, KartNo,
Departman, Unvan) VALUES ('"&kayit1&"', '"&kayit2&"', '"&kayit3&"',
'"&kayit7&"', '"&kayit8&"')")
Else
Rs.Movenext
End If
Wend
Rs.Close

I'll be glad if you help me to solve this problem.

Thanks...

nikkiH
03-29-2006, 03:16 PM
You are overwriting RS with the new insert query. This isn't the real issue here, but it's not a good habit to get into. Make another recordset object for that.

That said, where is Con opened? You need an open connection to execute a query.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum