Morning Everyone!!
I got what I hope is a simple answer.
Below is part of a code that I need help with. What this code does is it picks up some other data based on the itemnumber the customer has entered. The problem is if the customer enters in a number and that number is not in the database, it errors the script out. Can someone tell me how to set it up that if the itemnumber that the customer has entered is not valid some how flag it for a wrong number??
I got what I hope is a simple answer.
Below is part of a code that I need help with. What this code does is it picks up some other data based on the itemnumber the customer has entered. The problem is if the customer enters in a number and that number is not in the database, it errors the script out. Can someone tell me how to set it up that if the itemnumber that the customer has entered is not valid some how flag it for a wrong number??
Code:
If Session("i1") = "" Then
Else
Dim ticket1, sql1
Set ticket1 = Server.CreateObject("ADODB.Recordset")
sql1 = "SELECT * FROM inven WHERE itemnum = '" & Session("i1") & "' ;"
ticket1.Open sql1, db, adOpenForwardOnly, adLockOptimistic
Session("d1") = ticket1("disc")
ticket1.Close
end if
