I have some code which displays various HTML elements if certain conditions are met.
At the moment, if my SQL statements are met, the page will display SHOW PRICES.
If my SQL statements are not met, the page will display NO PRICES.
This all works fine, however I'm having a problem.
If my SQL statements are met, but the record found is NULL, it will give an error.
I want to display NO PRICES if bFound = False OR (myvar) is null.
Can somebody help me with this...
At the moment, if my SQL statements are met, the page will display SHOW PRICES.
If my SQL statements are not met, the page will display NO PRICES.
This all works fine, however I'm having a problem.
If my SQL statements are met, but the record found is NULL, it will give an error.
I want to display NO PRICES if bFound = False OR (myvar) is null.
Can somebody help me with this...
Code:
<%
pickup = request.form("frmpick")
dropoff = request.form("frmdrop")
set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("db.mdb") & ";"
myconn.open (connection)
set rs=Server.CreateObject("ADODB.recordset")
Dim bFound
bFound = True
MY SQL STATEMENTS
Else
bFound = False
%>
[b]<p>NO PRICES</p>[/b]
<%
End If
If bFound Then
If Not RS.EOF Then
%>
<p>SHOW PRICES</p>
<%
rs.Close
Set rs = Nothing
myconn.Close
Set myconn = Nothing
End If
End If
%>