Need help with ASP database call
Linc
OwnerDetroit Icrontian
I have a field in a Access database called "waterproof" as datatype Yes/No.
This is the relevant portion of my html form and asp code to assemble the SQL query. My code goes nuts and gives me an error on the Conn.Open(DSN); line (not shown) when I try to enter anything for the waterproof field. It does the same for my other Yes/No field, and for one other field that I may ask another question about later.
This is the html form field:
[PHP]
Waterproof:
<select name="waterproof">
<option value=""></option>
<option value="TRUE">Yes</option>
<option value="FALSE">No</option>
</select>
[/PHP]
skipping all the stuff inbetween and condensing what I know works ok, here is where the waterproof variable is handled:
Any thoughts?
This is the relevant portion of my html form and asp code to assemble the SQL query. My code goes nuts and gives me an error on the Conn.Open(DSN); line (not shown) when I try to enter anything for the waterproof field. It does the same for my other Yes/No field, and for one other field that I may ask another question about later.
This is the html form field:
[PHP]
Waterproof:
<select name="waterproof">
<option value=""></option>
<option value="TRUE">Yes</option>
<option value="FALSE">No</option>
</select>
[/PHP]
skipping all the stuff inbetween and condensing what I know works ok, here is where the waterproof variable is handled:
sql = "SELECT * FROM main WHERE ("; var waterproof1 = String(Request("waterproof")); if (waterproof1 != "") { if (comma == "TRUE") sql = sql + " and"; sql = sql + " waterproof = '" + waterproof1 + "'"; comma = "TRUE"; } sql = sql + ") ORDER BY style";
Any thoughts?
0
Comments
I've not done much sql, but that is what you get if comma is true. Is the WHERE(and...) possibly part of the problem?