Whats whith this code?

Results 1 to 3 of 3

Thread: Whats whith this code?

  1. #1
    Join Date
    Dec 1969

    Default Whats whith this code?

    Can someone tell me whats wrong with this code:<BR><BR>&#060;!--#include file="adovbs.inc"--&#062;<BR>&#060;!--#include file="db.asp"--&#062;<BR>&#060;% <BR><BR>mytable = "Playstation2" <BR><BR>Call DeleteTop<BR><BR>&#039;Delete top record<BR> &#039;Conn inside of db.asp<BR>Sub DeleteTop<BR> strInsSQL = "DELETE * FROM "& myTABLE &" where Ordernumber = 41"<BR> response.write "<BR>" & strInsSQL<BR> Set rs = conn.Execute(strInsSQL)<BR>End Sub <BR><BR>%&#062;<BR><BR>I get the following error:<BR><BR>Error Number -2146827864 <BR>Error Code <BR>Error Description Object required: &#039;&#039; <BR>ASP Description <BR>Category Microsoft VBScript runtime <BR>File Name /test.asp <BR>Line Number 13 <BR>Column -1 <BR><BR><BR>Thank You<BR>Aaron

  2. #2
    Join Date
    Dec 1969

    Default Scope

    When you define &#039;conn&#039; outside a sub, you can&#039;t use it inside a sub.<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Whats whith this code?

    1. It seems conn is out of scope. <BR> Check if conn is assigned with connection object.<BR> And connection is open<BR>2. Use conn.Execute(strInsSql,,adCmdText)<BR>3. One more observation :<BR> Delete doesn&#039;t have * <BR> It will be "DELETE FROM .."

Posting Permissions

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