GRQNET
|
| Posted: 06/10/2004, 6:47 AM |
|
Hi, I'm a newbe to programming.
I am attempting to create a List Box that allows the user to do a muliple
selection of towns and be able to display any of the results search for.
Right now my code just does an AND function. That is if I select the towns
Greenlawn and Melville, the search results show nothing instead of BOTH
towns.
I am using ASP.
Here is my SQL code for the table.
SELECT DISTINCT c21aalistings.new_bath_tot, c21aalistings.ml_link,
c21aalistings.bath_full, c21aalistings.bath_half, c21aalistings.bath_tot,
c21aalistings.br, c21aalistings.constr, c21aalistings.county,
c21aalistings.lp_dol, c21aalistings.ml_num, c21aalistings.sd_name,
c21aalistings.sd_num, c21aalistings.style, c21aalistings.taxes,
c21aalistings.town FROM c21aalistings LEFT JOIN NassauTowns ON
c21aalistings.town = NassauTowns.town
WHERE (NassauTowns.town IN ('{s_nassautown}') OR ('{s_nassautown}'='0') )
I notice that if I change the code to what the CodeCharge ExamplePack says.
SELECT DISTINCT c21aalistings.new_bath_tot, c21aalistings.ml_link,
c21aalistings.bath_full, c21aalistings.bath_half, c21aalistings.bath_tot,
c21aalistings.br, c21aalistings.constr, c21aalistings.county,
c21aalistings.lp_dol, c21aalistings.ml_num, c21aalistings.sd_name,
c21aalistings.sd_num, c21aalistings.style, c21aalistings.taxes,
c21aalistings.town FROM c21aalistings LEFT JOIN NassauTowns ON
c21aalistings.town = NassauTowns.town
WHERE (NassauTowns.town IN ({s_nassautown}) OR ('{s_nassautown}'='0') )
(I removed the quotes around the first {s_nassautown} )
I get the following error:
Form: Grid c21aalistings
Error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Expected 2. (Microsoft OLE DB Provider for ODBC Drivers)
Anthony
Thanks in advance for the help!!
|
|
|
 |
|