Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql -- too many rows

Status
Not open for further replies.

TRYP

Programmer
Jun 20, 2000
136
US
Im getting back too many rows in my SQL query.
in the following code
lookAt="title"
and
lookFor="asst mgr"

recEmps.Open "Select * from employee where (" & lookAt & " = '" & lookFor & "')", conPool, adOpenStatic, adLockOptimistic

im getting back rows where title="mgr"

am i doin something wrong or is this a natural SQL thing to search the string for an occurance of a string and not do a tru compare?
 
This is not standard for SQL. You can perform that type of where clause by using LIKE instead of =.

As for your problem, try hard coding the expression
....WHERE title='asst mgr'
to see if that returns the correct recordset. If it does, then there may be a problem with your variables. I cannot see anything wrong with the line of code.

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top