I am trying to use a recordset to search for a record in a database. By passing a sql statement to the recordset, requerying, and then checking to see if it is empty. For example.
sqlString = "select * from dbo.EM where emLastName = '"& LastName & "'"
Recordset2.setSQLText(sqlString)
Recordset2.requery
if Recordset2.getCount() = 0 then
Response.Redirect("first_page.asp?Result=Failed"
End if
Correct me if I am wrong, but shouldn't this recordset be empty if LastName does not exist? Any suggestions on a better way to approach this?
sqlString = "select * from dbo.EM where emLastName = '"& LastName & "'"
Recordset2.setSQLText(sqlString)
Recordset2.requery
if Recordset2.getCount() = 0 then
Response.Redirect("first_page.asp?Result=Failed"
End if
Correct me if I am wrong, but shouldn't this recordset be empty if LastName does not exist? Any suggestions on a better way to approach this?