Classic ASP and null values assigned to variables
Posted on 2012-03-16
I have encountered a strange issue that has just started in the past couple days. Up until recently, I would sometimes assign a value to a variable from a query. If the value of the query results was null in teh table itself, then my .asp pages treated that variable the same as if it was a blank value. So, for example, here is what I'm using to test:
set rs = Server.CreateObject ("adodb.Recordset")
ssql = "SELECT Field FROM Table WHERE (ID = 123)"
rs.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly
if not rs.eof then
strField = rs("Field")
if IsNull(strField) then
if strField = "" then
In the table itself, if I make the value for the field null, then the page prints out "test1". If I make the value blank, then it spits out "test2".
before recently, if the value was null, it would spit out "test2", and I don't know if it would spit out "test1" or not because I have never had to code for it.
Has anyone else experienced this change? The web server is 2008 r2, and the sql database is sql-2000 on server 2000. I have change nothing in terms of code or connection properties or table structures. The last updates were installed on the 4th of march that I can see. This could have been happening since that time, but I doubt it.
The one change I have done recently that I know of is I added a new web site on the web server. The new web site on the server points to the same physical location as another web site, but it has no authentication checked. Is it possible the newly created site with no authentication is messing up with the existing site with authentication? meaning, both sites point to d:\inetpub\xyz, one site has Windows Authentication turned on, another has no authentication and allows anon. I can't remove it at this time as it is being used, but I can remove it on Monday.
The servers, all of them, will reboot over the weekend, so I'll wait to see if that fixes it also.
Anyone else experienced this recently?