
March 27th, 2003, 04:30 AM
|
|
Junior Member
|
|
Join Date: Mar 2003
Location: NIG
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Error Message
Hi all,
I have two forms, form1 and form2, form1 receives a phone number POST it to form2 which select from an MS SQL DB and populate form2.
My problem is I want an alert or a meaningfull Error message to be displayed when a user enters a phone number that is not in the Database , below is my piece of code for the form that is getting populate;
<%
category = TRIM( Request.Form( "cat" ) )
username = TRIM( Request.Form( "username" ) )
IF username <> "" THEN
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.Open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul"
Set RS= Server.CreateObject( "ADODB.Recordset" )
If category = "Globe" then
RS.Open "select * from globe where phonenum = '" &username& "'", Con
firstname = RS.Fields("firstname")
lastname = RS.Fields("lastname")
middlename = RS.Fields("middlename")
homeadd = RS.Fields("homeadd")
busadd = RS.Fields("busadd")
terrifplan = RS.Fields("terrifplan")
state = RS.Fields("state")
phonenum = RS.Fields("phonenum")
typeofpay = RS.Fields("typeofpay")
assignedto = RS.Fields("assignedto")
nservicereq = RS.Fields("nservicereq")
//Comment = RS.Fields("Comment")
End if
Con.Close
Set RS = Nothing
Set Con = Nothing
END IF
%>
Thanks
Abd
|