Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple error message "problem"

Status
Not open for further replies.

amisima

Programmer
Jun 11, 2003
13
0
0
CA

--------------------------------------------------------------------------------

Hi,

I have this update page. The user enters in a record to be updated on a form. The page then displays the record to be updated. I am trying to add a error message to check if what the user typed in doesn't match anything in my database. I have an if statement to do the error checking. It works when the user enters in a record that doesn't match one in my database. The if statement fails when the user enters in a record that matches in the database. The error message "that record doesn't exist!!" appears when the records do match, the matching record appears along with the error message. Here is my if statement. Can anyone help?

if trim(ucase(request.form(&quot;frm_title&quot;))) <> trim(ucase(rs.fields(&quot;title&quot;))) then
response.write(&quot;that record doesn't exist!!&quot;)
%><br><%
end if


Thanks,

Amisima
 
Amisima

why not just do a
sql = &quot;SELECT * FROM table WHERE title='&quot; & trim(ucase(request.form(&quot;frm_title&quot;))) & &quot;'&quot;

then a
Set rs = connection.Execute(sql)

all you need to check is
If rs.EOF = True Then
response.write(&quot;that record doesn't exist!!&quot;)
end if

and you can't use those <% %> within <% %>

_____________________________________________________________________
onpnt2.gif

[bdaycandle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top