Results 1 to 19 of 19

Thread: [Resolved]SQL Statement error

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Posts
    48

    Resolved [Resolved]SQL Statement error

    Hi

    Im trying to search the database for the first name. and I get an error " Too few parameters. Expected 2". Could someone help me out. Maybe its very simple and ive gone mad looking at the statement for 5 hrs. Thanks in advance.

    VB Code:
    1. sqlsearch = "SELECT Contact.FirstName, Contact.LastName From Contact WHERE (((Contact.FirstName) Like '" & frmMain.txtSearch & "*')) ORDER BY Contact.FirstName, Contact.LastName;"
    2.  
    3. Set db = OpenDatabase("P:\Contact.mdb")
    4. Set rs = db.OpenRecordset(sqlsearch)
    Last edited by dawgfather; Jul 20th, 2005 at 10:32 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width