R
Robert Jones
I am trying to set up an ASP site on a Windows 2003 server and am having
problems connecting to the database.
To isolate the problem I created a simple ASP test page which simply created
an ADO connection object, connected to the database and returned some
results.
When I ran the code as a VBS file it worked fine, but when I run it as an
ASP page (obviously with slight adjustments such as replacing MsgBox with
Response.Write etc) it just returns a "Page cannot be displayed" error.
Using SQL Server Profiler reveals that while the VBS file does connect to
the database, the ASP page does not.
The other strange/annoying thing is that I cannot get an error other than an
Error 500 "Page cannot be displayed" error when something goes wrong.
I would guess that the user security for the IIS user is somehow set to not
allow it to connect to the database (by the way - the database is on the
same server as the IIS server), but I don't know how to fix this problem.
Also note this is a new server, so I am assuming these are default settings.
One other point of interest.
If I run code to connect to the database it appears to work (it doesn't
error) - although SQL profiler reveals the connection was not actually made.
I only get the error if I try to process a record set, so calling a method
which fails (such as ADODB.Connect Open) doesn't generate an error, but
trying to reference an Uninstantiated object (such as a recordset) does give
the error.
Thanks for any help you can give.
problems connecting to the database.
To isolate the problem I created a simple ASP test page which simply created
an ADO connection object, connected to the database and returned some
results.
When I ran the code as a VBS file it worked fine, but when I run it as an
ASP page (obviously with slight adjustments such as replacing MsgBox with
Response.Write etc) it just returns a "Page cannot be displayed" error.
Using SQL Server Profiler reveals that while the VBS file does connect to
the database, the ASP page does not.
The other strange/annoying thing is that I cannot get an error other than an
Error 500 "Page cannot be displayed" error when something goes wrong.
I would guess that the user security for the IIS user is somehow set to not
allow it to connect to the database (by the way - the database is on the
same server as the IIS server), but I don't know how to fix this problem.
Also note this is a new server, so I am assuming these are default settings.
One other point of interest.
If I run code to connect to the database it appears to work (it doesn't
error) - although SQL profiler reveals the connection was not actually made.
I only get the error if I try to process a record set, so calling a method
which fails (such as ADODB.Connect Open) doesn't generate an error, but
trying to reference an Uninstantiated object (such as a recordset) does give
the error.
Thanks for any help you can give.