problems with passing user input to a query
im trying to create a page which enables a user to search a database. The search page is simple, it contains a text box and a submit button. my problem is, whenever i try to use the user input as a criteria to do the search, it doesnt do anything. here is my sample code:
<%
Option Explicit
Dim strConnect
%>
<HTML>
<HEAD>
<TITLE>Search Page</TITLE>
</HEAD>
<BODY>
<%
Dim strSearch, strCriteria, strsql, objrs, Conn
strSearch = Request.Form("system")
'Set Conn = Server.CreateObject("ADODB.CONNECTION")
Set objRS = Server.CreateObject("ADODB.Recordset")
'Response.Write strSearch
strsql = "Select * From SYSTEMS_IN_QA Where SYSTEM ='&strSearch&'"
objRS.Open strsql, strConnect
'Response.Write objrs("SYSTEMS")
Response.Write RecToTable(objrs)
objRS.Close
Set objRS = Nothing
%>
</BODY>
</HTML>
The RecToTable is a function that writes the output to a table. When i fun this the only thing i get are the headings or the field names. The value that im looking for or the output does not show up. I need some advice. any help would be much appreciated. Thanks.
AT.
|