How can you write an SQL query in ASP in which the field in the WHERE clause

  • Thread starter Thread starter celldude92
  • Start date Start date
C

celldude92

Guest
is specified using a query string? Usually, you specify records WHERE fieldname='value'. However, I need to display records in ASP WHERE querystring='yes'.

So far, I have:

strURL = Request.QueryString("CommitteeName")
to name the query string value, and

strSQL = "SELECT * FROM tblParents WHERE " & strURL & "=Yes ORDER BY ParentName;"
as my SQL statement.

However, this is a problem because it returns all records. Please tell me what I am doing wrong. Thanks!
 
Back
Top