Syntax Problem?

Results 1 to 2 of 2

Thread: Syntax Problem?

  1. #1
    Join Date
    Dec 1969

    Default Syntax Problem?

    Fairly new to ASP, here is my question though. I have 3 tables:<BR>1)MIFIRM<BR>2)MICOUNTY<BR>3)MIJUNCTION< BR><BR>1 to many between<BR>MIFIRM & MIJUNCTION<BR>MICOUNTY & MIJUNCTION<BR><BR>Thank you very much for any help! Josh Walkerdine<BR><BR><BR>&#060;%<BR>Query = "SELECT MIFIRM.FIRMID, MIFIRM.FIRM, MIJUNCTION.COUNTYNAME<BR>FROM MICOUNTY INNER JOIN (MIFIRM INNER JOIN MIJUNCTION ON MIFIRM.FIRMID = MIJUNCTION.FIRMID) ON MICOUNTY.COUNTYNAME = MIJUNCTION.COUNTYNAME<BR>WHERE (((MIJUNCTION.COUNTYNAME) Like &#039;%))"<BR>Query = Query & Request("COUNTY") & "%&#039;"<BR>Query = Query & " ORDER BY COUNTY"<BR>Set DataConn = Server.CreateObject("ADODB.Connection")<BR>DataCon n.Open "ATTORNEYLINK"<BR>Set RSlist = Server.CreateObject("ADODB.recordset")<BR>RSlist.O pen Query,DataConn,1,2<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default debug your sql

    response.write(query) before you post it to the database, but at first glance your error may be generated righ here:<BR><BR>WHERE (((MIJUNCTION.COUNTYNAME) Like &#039;%))" &#060;--<BR>Query = Query & Request("COUNTY") & "%&#039;" <BR><BR>your resulting sql would look like this...<BR><BR>...WHERE (((MIJUNCTION.COUNTYNAME) Like &#039;%))Washington%&#039;...<BR><BR>-- Whol <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