Error in adodb.recordset

Results 1 to 2 of 2

Thread: Error in adodb.recordset

  1. #1
    Join Date
    Dec 1969

    Default Error in adodb.recordset

    set Conn = Server.CreateObject("ADODB.Connection")<BR>set rst = server.createObject("ADODB.Recordset")<BR>sql = "INSERT INTO TABLENAME VALUES(&#039;AAA&#039;)<BR>set rst = conn.execute(sql)<BR>if rst.errors.count &#062; 0<BR> response.write "Error"<BR>else<BR> rst.close<BR> set rst = nothing<BR> conn.close<BR> set conn = nothing<BR>end if<BR><BR>------------------------<BR>error i got<BR>------------------------<BR>operation not allow when the object is close<BR>So, if i removed the rst.close and also the rest of code. i din get any error. Is the control directly pass back to the server once the server call the sqlserver to execute the sql? or the server will wait until the sql statement has been executed?<BR>Thanx!

  2. #2
    Join Date
    Dec 1969

    Default There isn't any recordset!

    When you EXECUTE an INSERT, UPDATE, or DELETE query, there isn&#039;t any recordset returned, at all, ever!<BR><BR>Get rid of the <BR>&nbsp; &nbsp; SET RS = <BR>in that code. It is doing nothing useful.<BR><BR>(In fact, what it is actually doing is the same thing as:<BR>&nbsp; &nbsp; conn.Execute( sql )<BR>&nbsp; &nbsp; Set rst = nothing<BR>Really!)<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts