Forums
This topic is locked
Error "Too few parameters. Expected 1"
Posted 16 Nov 2001 21:14:52
1
has voted
16 Nov 2001 21:14:52 Val Dubuis posted:
I am getting ODBC MS Access Driver Error"Too few parameters. Expected 1"
I am trying to select records matching search criteria.
Here is SQL:
SELECT login_name, mem_date, city, tblAge.Age, gender_name
FROM member_info, tblAge, tblCountry, tblGender, tblState
WHERE tblAge.AgeID = member_info.age AND member_info.age > varAgemin AND member_info.age < varAgemax AND member_info.country = tblCountry.country AND member_info.gender = tblGender.gender AND member_info.gender = varGender AND member_info.state = tblState.state AND member_info.city LIKE varCity
Everything works fine until I add last line -
"member_info.city LIKE varCity"
varCity is a string:
default value: Moscow
run-time value: Request("txtCity"
I tried putting all sorts of quotation marks around default value and nothing works.
This brings the second question: How to make default value equal to empty string or anything - it would not take " " or * or "*"???!!!
Replies
Replied 17 Nov 2001 04:51:58
17 Nov 2001 04:51:58 Joel Martinez replied:
did you try putting single quotes around the variable:
LIKE 'varCity'
then that way, if it's empty, it will see '' instead of ... nothing, th us causing a syntax error.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
LIKE 'varCity'
then that way, if it's empty, it will see '' instead of ... nothing, th us causing a syntax error.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 17 Nov 2001 06:56:28
17 Nov 2001 06:56:28 Val Dubuis replied:
Yes, single quotes worked! What was I thinking???
Thanks again, Joel
Valentina
Thanks again, Joel
Valentina