ASP can't execute one SQL statement, pls help!

Results 1 to 5 of 5

Thread: ASP can't execute one SQL statement, pls help!

  1. #1
    WinDraGon Guest

    Default ASP can't execute one SQL statement, pls help!

    Hi all,<BR><BR>I have one question, hope you guys can help me out. thx<BR><BR>I have one SQL statement, it runs fine. <BR><BR>if exists(select calltime from calls where calltime like &#039Apr 11%&#039) print "YES" else print "NO"<BR><BR>It will returns either YES or NO.<BR><BR>I just wondering, how this SQL run under ASP?<BR>as I learn, ASP run likes this:<BR><BR>sql = "select callid from call where calltime like &#039APR 11%"<BR>set id = conn.Execute(sql)<BR>getID = id("callid")<BR><BR>so, how can I run that SQL with "If exists (blah balh)" statement under ASP?<BR><BR>Thx for your help.<BR>:))<BR><BR><BR><BR>

  2. #2
    mec Guest

    Default RE: ASP can't execute one SQL statement, pls h

    open a connection<BR>set id = conn.Execute(select ...)<BR><BR>if not id.BOF then <BR> print yes<BR>else <BR> print no<BR>end if <BR><BR><BR>

  3. #3
    WinDraGon Guest

    Default RE: ASP can't execute one SQL statement, pls h

    Thx for your help, I have looked at BOF and EOF,<BR>I tried it both in my case.<BR><BR>if not id.BOF then...<BR>if not id.EOF then...<BR><BR>they both work fine...So, would that be any diff, if I use EOF instead of BOF ??<BR><BR>Thx again :))<BR><BR>

  4. #4
    mec Guest

    Default RE: ASP can't execute one SQL statement, pls h

    you should use if not id.BOF because BOF indicates that the current record position is before the first record in a Recordset object.<BR><BR>


  5. #5
    Joel Nelson Guest

    Default RE: ASP can't execute one SQL statement, pls h

    If the query does NOT return at least one record then both EOF and BOF will be true. If at least one record comes back then both EOF and BOF will both be false as the recordset pointer will be on the first record.

Posting Permissions

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