Assuming your FORM's METHOD is "POST", it would look something like this:
Dim sSQL, rsRecordset, sConString
' set the connection
sConString = "your valid DSN connection string here"
' create the rs object
Set rsRecordset = Server.CreateObject("ADODB.Recordset")
' create the SQL
sSQL = "SELECT * FROM some_table WHERE " & _
"last = '" & Replace(Request.Form("last"), "'", "''") & "' " & _
"ORDER BY last"
' get the data
rsRecordset.Open sSQL, , adOpenForwardOnly
' cycle the data
Do Until rsRecordset.EOF
Response.Write rsRecordset("first") & _
" " & rsRecordset("last") & "<BR>" & vbCrLf
Loop
You should seriously consider getting a book on ASP and/or ASP databases
(both are available from Wrox).
? Chuck
> -----Original Message-----
> From: Navnit Bhatia [mailto:nav78@u...]
> Sent: Thursday, May 24, 2001 8:33 AM
> To: ASP Databases
> Subject: [asp_databases] capturing a value
>
>
> hello, anyone could help me in capturing a value from a txtbox and
> comparing it with a value from sql database. How do i write an sql query
> for it?
>