I am new to this a need to update a page that I did not code. What I need to do is take the value entered into a textbox and add it to a query. The user would enter somthing like %value% (% being wildcard) into the text box and then click a search button. This would then add this value to the query. I know the sql just do not know how to add to the query or get the value from the textbox. The db is Oracle. Hope this makes sense. Part of the code is below.
<form action="time_to_project_by_project_number-dynamic.asp" method="POST" name="parmform"> <table border="1"> <tr> <td>Project Number Search:td> <td> <input id="txtSearch" type="text" /> <input id="btnSearch" type="button" value="Search" /> td> tr> <tr> <td>Select Project Number(s): td> <td> <% parmid = "P1" provider = "MSDASQL" datasource = "dbname" username = "username" password = "password" databasetable = "tablename" valuedatabasecolumn = "columnname" strConn = "Provider=" & provider & ";Data Source=" & datasource & ";User ID=" & username & ";password=" & password & ";" query = "SELECT DISTINCT " & valuedatabasecolumn & "," & valuedatabasecolumn & " || ' - ' || description " query = query & " FROM " & databasetable query = query & " where POST_DATE >= to_date('01/01/2007', 'MM/DD/YYYY')" txtSearch=request.form("txtSearch") set conn = Server.CreateObject("ADODB.Connection") conn.Open strconn set rs = conn.Execute( query ) Response.Write("") rs.close set rs = nothing set conn = nothing %>
Replies
Know the answer? Post it — somebody with the same question will find it here.