SQL - Can't Detect records in the access database

Results 1 to 2 of 2

Thread: SQL - Can't Detect records in the access database

  1. #1
    Join Date
    Dec 1969
    Posts
    169

    Default SQL - Can't Detect records in the access database

    I&#039ve encountered some problem with SQL statements. I&#039ve selected some records<BR>--------------------------------------------------<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR> Set rs = Server.CreateObject("ADODB.RecordSet")<BR> Conn.Open "data_base"<BR> sql = "select * from Reservation where Resource = &#039 "&request.form("resource")&" &#039"<BR> rs.open sql, conn, 3, 3<BR><BR><BR>If rs.recordcount = 0 then<BR> ....<BR>else<BR> .....<BR><BR>----------------------------------------------<BR>but the SQL statement don&#039t seems to detect this record in the access database(the record I requested is actually in the database). I would appreciate if you could give some advices on this.<BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: SQL - Can't Detect records in the access database

    Did you know that you seem to have extra spaces between the single tick and the closing double quote:<BR><BR>"select * from Reservation where Resource = &#039*"&request.form("resource")&"*&#039"<BR><BR>S ee what I mean? I put an * where you seem to have an extra space.<BR><BR>Try getting rid of these spaces.

Posting Permissions

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