dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: SQL command not working any ideas? Code included

  1. #1
    Join Date
    Jun 2006
    Posts
    290

    SQL command not working any ideas? Code included

    Hey everyone... can someone please help me and modify this line of code so it works?

    rs.Open "select * from `clients` where `restaurant` like '" & r & " ' and `zip` like '" & z & "' and `cuisine` like '" & c & "' and `price` like '" & p & "'", conn


    r, z, c, and p are dim'd as strings prior to this

    if text1.text = "" then
    r = "%"
    end if

    thats how im using it... any ideas??

  2. #2
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    Seem to have too many ' ' ' ' ....

    Try :-

    rs.Open "select * from clients where restaurant like '" & r & "' and zip like '" & z & "' and cuisine like '" & c & "' and price like '" & p & "'", conn

    Also note the removal of the space in r & " ' and ... although not entirely sure if this is critical or not

    Greg

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 05:14 PM
  2. Microsoft's C++ bigotry
    By Phil Weber in forum .NET
    Replies: 632
    Last Post: 10-01-2003, 12:00 AM
  3. Replies: 0
    Last Post: 04-03-2001, 04:32 PM
  4. converse asp code for access database from sql
    By deane in forum authorevents.mitchell
    Replies: 0
    Last Post: 10-16-2000, 10:41 PM
  5. Replies: 1
    Last Post: 09-04-2000, 11:33 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center