The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Script not returning value in ELSE

Hello,

First time poster and fairly new to ASP programming.

I am trying to add a functionality that checks if a field is empty, if so return a set value.
Here is what i have got so far:

Code:

'rsGlobalWeb is basicly declared the same as rsBackup just in a different asp file with also the db connection.
<% If rsGlobalWeb("Serial") <> "" Then
response.write("<td>" & rsGlobalWeb("Serial") & "</td>")
Else
SqlBackup = "SELECT * FROM CMDBbackup WHERE Naam_Cattools = '" & rsGlobalWeb("Device_name") & "'"
Set rsBackup = Server.CreateObject("ADODB.Recordset")
rsBackup.Open SqlBackup, dbGlobalWeb, 3
If Not rsBackup.EOF Then
If Not IsNull(rsBackup("Serial")) And (rsBackup("Serial") <> "") Then
response.write("<td>" & rsBackup("Serial") & " (backup)</td>")
Else
response.write("<td>No historical data found</td>")
End if
End if
End if
%>

Now for the problem: when there is a value in the backup database it shows that value combined with the "(backup)" behind it. So that is working fine. The problem is that when there is no value found, it does not return anything.

I have tried do to some google searches but perhaps i am overlooking something here.
Any thoughts what it could be?