The site and component work for a while but every two weeks to a month
the following error occurs and does not stop until we unload the
components:
Active Server Pages error 'ASP 0241'
CreateObject Exception
/USOCActions.asp
The CreateObject of '(null)' caused exception C0000005.
Server object error 'ASP 0177 : c0000005'
Server.CreateObject Failed
/USOCActions.asp, line 146
c0000005
A few additional things to note:
1. A test VB executable can create and use the dll on the web server
with no problems while IIS can not create using CreateObject. So yes,
the component is registered.
2. This dll hits a database, however, it does not store a record set
in memory. In fact the record set is defined in a function and should
fall out of scope.
3. Once I clear the IIS cache the site works fine for a period of
a week to a month but I get the above message at some point.
4. Option explicit is turned on.
Here is the code (LINE 146 is marked with 'LINE 146 -->' on the left
margin):
<% option explicit%>
<%
on error goto 0
server.ScriptTimeout = 1000
Response.Buffer = True
%>
<HTML>
<SCRIPT LANGUAGE="JavaScript">
window.defaultStatus = "Loading information..."
// This script is intended for use with a minimum of Netscape 4 or IE
4.
if(document.layers) {
var ns4 = true;
}
if(document.all) {
var ie4 = true;
}
function showObject(obj) {
if (ns4) obj.visibility = "show";
obj.visibility = "visible";
}
function hideObject(obj) {
if (ns4) {
obj.visibility = "hide";
}
if (ie4) {
obj.visibility = "hidden";
}
}
</SCRIPT>
<BODY BGCOLOR="#FFFFFF">
<DIV ID="splashScreen"
STYLE="position:absolute;z-index:5;top:30%;left:35%;">
<TABLE BGCOLOR="#000000" BORDER=1 BORDERCOLOR="#000000"
CELLPADDING=0 CELLSPACING=0 HEIGHT=200 WIDTH=300>
<TR>
<TD WIDTH="100%" HEIGHT="100%" BGCOLOR="#CCCCCC" ALIGN="CENTER"
VALIGN="MIDDLE">
<BR><BR>
<FONT FACE="Helvetica,Verdana,Arial" SIZE=3
COLOR="#000066"><B>Page Loading. Please wait...</B></FONT>
<BR>
<IMG SRC="images/wait.gif" BORDER=1 WIDTH=75 HEIGHT=15><BR><BR>
</TD>
</TR>
</TABLE>
</DIV>
<%
'flush the body and div elements to the browser
Response.Flush
'attempt to get username and password.
'if present then login
'check user role if valid transfer to menu.asp
dim bMgr
dim iCount
dim strSection
dim strTransfer
dim strUSOC
dim strILEC
dim strMatchType
dim strNameMatch
dim objConn
dim objRS
dim strSQL
dim objUSOC
bMgr = false
Session.Contents("SearchString") = ucase(Request.Form("txtUSOC"))
session.Contents("ILEC") = Request.Form("cboILEC")
session.Contents("MatchType") = Request.Form("selMatchType")
call Search
'increment section hit count
set objConn = server.CreateObject("ADODB.Connection")
call Connect(objConn,session.Contents("DOMAIN"))
call IncrementHitCount("USOC SEARCH",objConn)
objConn.close
set objConn = nothing
%>
<script language="JavaScript">
var splash = document.all.splashScreen.style;
hideObject(splash);
</script>
<%
if strTransfer <> "" then
call server.Transfer(strTransfer)
end if
function BuildUSOCResults(strSQL)
dim objConn
dim objRS
dim objArray
dim strtempprint
set objRS = nothing
set objConn = server.CreateObject("ADODB.Connection")
set objRS = server.CreateObject("ADODB.RecordSet")
call Connect(objConn,session.Contents("DOMAIN"))
objRS.CursorLocation = 3
Call objRS.Open(strSQL, objConn,3,1)
set Session.Contents("USOCRESULTS") = nothing
redim objArray(objRS.RecordCount)
iCount = 0
while objRS.EOF = false
LINE 146 --> set objUSOC = server.CreateObject("BTUSOC.clsUSOC")
objUSOC.ID = objRS.Fields("USOC_DEF_ID").Value
objUSOC.Name = objRS.Fields("USOC_PATTERN").value
set objArray(iCount) = objUSOC
iCount = iCount+1
set objUSOC = nothing
objRS.MoveNext
wend
objRS.Close
objConn.close
set objRS = nothing
set objConn = nothing
Session.Contents("USOCRESULTS") = objArray
end function
function Search()
strUSOC = ucase(Session.Contents("SearchString"))
strILEC = session.Contents("ILEC")
strMatchType = session.Contents("MatchType")
if strUSOC <> "" AND strILEC <> "" AND strMatchType <> "" then
strNameMatch = replace(strUSOC,"+","_")
strSQL = "SELECT STMNT"
Call BuildUSOCResults(strSQL)
end if
end function
%>
</BODY>
</HTML>
HTH,
Bob Barrows
> <FONT
FACE="Helvetica,Verdana,Arial" SIZE=3
>COLOR="#000066"><B>Page Loading. Please
wait...</B></FONT>
>.
>
Thanks for your response. We have tried the security route with no
joy.
When the createobject is failing we click the unload button for the
site or shut down the site and restart it OR restart IIS. After we
take any of those actions the component can be created just fine for a
period of 2 weeks to a month. The security of users on the server
does not change during this timeframe. After 2 weeks to a month then
we get the createobject error for that component.
This would point to something other than permissions issues (since
permission issues would be consistent). But still with some issue
with IIS or ASP creating the object as other VB6 test exe's can create
and use the component with no issues. It is almost like the component
becomes locked or lost in the registry but only for IIS/ASP and not
for other EXE's on that server.
"Bob Barrows" <reb_...@yahoo.com> wrote in message news:<089901c2d155$acafe870$8ef82ecf@TK2MSFTNGXA04>...