I have a form that writes to a csv file, and then another form that reads from that csv file, after an input field is completed, it must search the csv files and bring back any entries that match the input field.

It works with the date field I have (see code below)and if I enter a number in another field it works, however no matter what I try it refuses to work if there is text in the input field.

SQL="SELECT * FROM [Calendar.csv] WHERE (Left([Date],10)>='"&Request.Form("DateFrom")&"' AND Left([Date],10)<='"&Request.Form("DateTo")&"') ORDER BY [Date];"

Here is the code that is giving me the problem (actually just the Channels=... section):

SQL = "SELECT * FROM Calendar.csv WHERE Channels='" & request.form("Channels")  & "'"

so how do I get it to display my results from the search using the form "Channels" field?

PS - I have included a zip file with the html, asp and csv file, if you wish to have a look

Edited by Sleuth: n/a

7 Years
Discussion Span
Last Post by ArtistScope

Without looking at the code I would guess that the problem is with request.form("Channels")

Try establishing its value before using it in the SQL statement like...

Dim strChannel
strChannel = request.form("Channels")

SQL = "SELECT * FROM Calendar.csv WHERE Channels='" & strChannel & "' "

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.