Using 'Like' in Access Stored Procedure

Results 1 to 2 of 2

Thread: Using 'Like' in Access Stored Procedure

  1. #1
    Join Date
    Dec 1969

    Default Using 'Like' in Access Stored Procedure

    Hi All-<BR><BR>I&#039;ve been trying pass the following to an Access stored procedure via asp. Using Sql in in the asp works fine but when I try to convert it to the stored procedure format it fails to return any records. Executing the stored procure manually retrieves the expected records from Access. The other stored procedures work fine but the &#039;Like&#039; in the stored procedure seems to be troublesome. <BR><BR>1. the original code on and *.asp page <BR>dim fname,faddress,sSelect<BR><BR>faddress=left(Reques t.Form("address"),4)<BR>fname=Left(Request.Form("f irstname"),1)<BR><BR>sSelect="Select firstname,lastname,email," & _<BR> "mm,dd,yyyy,gender,address,address1,city,stateprov ,zipcode,phone," & _<BR> "status from tblMail where lastname=&#039;" & Request.Form("lastname") & "&#039; AND firstname Like &#039;" & fname & "%&#039; AND address Like&#039;" & faddress & "%&#039;"<BR><BR><BR>2. passing the paramaters to the access stored procedure<BR><BR>sSelect="Execute qry_MailFindUser &#039;" & Request.Form("lastname") & "&#039;,&#039;" & fname & "&#039;,&#039;" & faddress & "&#039;"<BR><BR>=============================<BR>E xecute qry_MailFindUser &#039;test&#039;,&#039;t&#039;,&#039;1&#039; <BR><BR>set rstemp=con.execute(sSelect)<BR>=================== ==========<BR><BR><BR>3. stored procedure as it exists in Access<BR><BR>SELECT firstname, lastname, email, mm, dd, yyyy, gender, address, address1, city, stateprov, zipcode, phone, status<BR>FROM tblMail WHERE lastname=@lastname AND firstname Like [@firstname %] AND address Like [@address %];<BR><BR>Thanks for your input<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default crosspost

    I know the temptation is to repost your question in different Forums but that is a nono. Most of the "main" people sit on the recent posts page and get around to answering when they can.<BR><BR><BR><BR>Please look at the original post.

Posting Permissions

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