query problem

Results 1 to 2 of 2

Thread: query problem

  1. #1
    Join Date
    Dec 1969

    Default query problem

    Query No1 give following error<BR>Query 1<BR>---------<BR>rs.Open "SELECT contractno,recordno,category,contractor FROM arc where contractno=&#039;"&contractno&"&#039;",cn,1,2 <BR>rs.PageSize=100<BR><BR>Error Type:<BR>ADODB.Recordset (0x800A0BCD)<BR>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.<BR>/dcil2/paging7.asp, line 27<BR><BR><BR>When I change query ie.<BR><BR>Query 2<BR>---------<BR><BR>rs.Open "SELECT contractno,recordno,category,contractor FROM arc where contractno=&#039;10 ’",cn,1,2 <BR>rs.PageSize=100<BR><BR>it give no error, whey ? how can use query no 1, I want to use query no.1 becasuse contractno value is dynamic (not constant) <BR>and contractno received the value from the previous page.<BR><BR>Mateen<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: query problem

    do this :<BR><BR><BR>strSQL = "SELECT contractno,recordno,category,contractor FROM arc where contractno=&#039;"&contractno&"&#039;"<BR>Response.Write(strSQL)<BR>rs.Open strSQL, cn,1,2 <BR>rs.PageSize=100<BR><BR><BR>and you&#039;ll see if what you&#039;re executing is what you THINK you&#039;re executing.<BR><BR><BR>j<BR>http://rtfm.atrax.co.uk/<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