I need the advice of an experienced ASP programmer.
I have copied ASP files from an HTML website and have now included them in an ASP.NET website.
Some of the files work, some don't. There appears to be a problem accessing the "Request" object.
For example, this code works fine (connectionstring hidden for security):
<%[login to view URL] = 60
[login to view URL] = Now() - 1
[login to view URL] "pragma","no-cache"
[login to view URL] "cache-control","private"
[login to view URL] = "no-cache"
Response.Buffer=True
ErrCode = 0
Set oConnection = [login to view URL]("[login to view URL]")
[login to view URL] "Provider=sqloledb; Network Library=DBMSSOCN; Data Source=xxxxxx; Initial Catalog=xxxxxx; User ID=xxxxxx; Password=xxxxxx;"
set rsSurveyors = [login to view URL]("select * from houses where reg_no > 0 and publicstatus not in ('RETIRED', 'NON-LICENSED', 'UNREGISTERED', 'DECEASED') order by sname asc")
%>
------------------------------------------------------------
------------------------------------------------------------
But this code does not work:
<%[login to view URL] = 60
[login to view URL] = Now() - 1
[login to view URL] "pragma","no-cache"
[login to view URL] "cache-control","private"
[login to view URL] = "no-cache"
Response.Buffer=True
ErrCode = 0
Session("ses") = ""
Set oConnection = [login to view URL]("[login to view URL]")
[login to view URL] "Provider=sqloledb; Network Library=DBMSSOCN; Data Source=xxxxxx; Initial Catalog=xxxxxx; User ID=xxxxxx; Password=xxxxxx;"
Function NullOrEmpty(variablename)
NullOrEmpty = false
if IsNull(variablename) or variablename="" then NullOrEmpty = true
end Function
if NullOrEmpty(Request("errcode")) = false then errcode = Request("errcode")
end if
%>
-----------------------------------------------------
-----------------------------------------------------
I don't know what the exact error is because it is not reporting one, and I am not running it through a specific debugger, but the code definately worked on the previous server.
If I comment out the final line (the one with request('errcode') in it) then the error disappears, so I think the problem is to do with accessing the request object.
Am running on Windows server under IIS and am assuming there is something to do with IIS configuration, but need some advice.
PLEASE DO NOT GUESS AT THIS - I have already tried google - I am hoping that someone out there has a good idea of what's actually going on.
Kind regards, Cerridiel.