Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP 0241 error

Status
Not open for further replies.

tonys123

IS-IT--Management
Apr 30, 2007
46
GB
Hi Guys

I have an application that was working perfectly until last night. All of a sudden, it has stopped and I am getting the following error:

Active Server Pages error 'ASP 0241'
CreateObject Exception
/bman/main.asp
The CreateObject of '(null)' caused exception C0000005.
Server object error 'ASP 0177 : c0000005'
Server.CreateObject Failed
/bman/includes/opendb.asp, line 2
c0000005

The code is dead simple as you can see (I have only put in the first few lines)

<%
Set cn = Server.CreateObject("ADODB.Connection")
cs = Server.MapPath("/bman/budget2002.mdb")
'dsn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & cs
dsn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & cs
'dsn = "BudgetManager"
cn.Mode = 3

The system fails on the Set cn = Server.CreateObject line. I am running this on a Win2K PC and accessing from Win XP machines. I reckon something has happened with IIS but am unable to determine what or how to fix it. Any help would be appreciated.


 
First I woudld reboot the machine, then I would make sure no security changes were made over night. Also find out if any changes at all were made.

Ordinary Programmer
MCAD
 
If that doesnt work find out if any patches were applied recently. Some patches don't take effect until reboot.
 
Guys

Thanks for your answers - we have restarted the server but no joy. Also, my IT dept assure me that no patches or security updates were applied. They tell me no changes at all have been made at all - could it be that the problem is due to patches etc. made to the client PC's?
 
...could it be that the problem is due to patches etc. made to the client PC's

This is definatley a server-side problem.

What if you make a .VBS file and try to run it on the server:

Code:
On Error Resume Next

Dim cn
Set cn = CreateObject("ADODB.Connection")

If err.Number = 0 Then
  MsgBox "No error"
Else
  MsgBox "Error creating ADO Connection"
End If

Set cn = Nothing


Just make that little test.vbs file on the desktop of your web server... you can type it up using Notepad. Save it and double click the icon to run it. If it makes an error then try reinstalling the MDAC.
 
Hi. Thanks for the sample code. We tried it on the server we are having a problem with and it returned No Error. However, when we changed your code to

Set cn = Server.CreateObject("ADODB.Connection")

we got an error. Our code has the Server. part. If we change it to be like the sample you wrote, we get an ASP 0115 error.

We tried on a separate server which has the same OS (Win2K) but which also has the latest MDAC and that gave the same results.
 
When you run it as a .VBS it is using the windows scripting enging instead of using the ASP environment so CreateObject is proper.

The purpose of the test was to see if the ADO Connection was actually a createable object on your server. IF the VBS code runs without error then it did create the object and the MDAC is not the problem.
 
Hi. Given that MDAC isn't the problem as the sample code you gave me works fine, any ideas what may be the cause of the problem?
 
Would you get an error with an ASP containing only this:
Code:
<%
Response.Write "The current time is: "

Dim cn
Set cn = Server.CreateObject("ADODB.Connection")

Response.Write cStr(Now)

Set cn = Nothing
%>
 
Hi. I've tried the code and yes, I still get the error. Therefore, we can happily say its not an application or database error but must definitely be an infrastructure problem...or maybe even hardware. I shall check the system logs to see if they give a clue...but I'm not holding my breath.
 
This may possibly be a permissions error.

When you run a .VBS script file by clicking it, it executes under the security context of the logged in user. Since you are logged into the web server you are probably the administrator or at least a domain user.

When you request an ASP through the browser, the script is executed in the security context specified by IIS. By default this is an account that is local to the server machine and therefore cannot access other domain resources like network shares,etc. Also the local account has limited access even to the web server itself... read only in many places and no access to some folders.

So possibly the account used by IIS has been changed or the permissions granted to the default account have been restricted.
 
Hi Guys

Thanks for all your help - we rebuilt a new server from scratch and that seems to have fixed the problem. What the original problem was we don't have a clue; fingers crossed it doesn't happen again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top