Hi,
Im trying to build some simple ASP Pages for our Intranet, I'm not a
developer.. just try to do the best I can. for several days everything works
great until this morning, on all my ASP pages I get this Error messages.
Active Server Pages error 'ASP 0241'
CreateObject Exception
/ict/ta_overview.asp
The CreateObject of '(null)' caused exception C0000005.
Server object error 'ASP 0177 : c0000005'
Server.CreateOb ject Failed
/ADO_webcontent. asp, line 21
c0000005
My search on the net, learned me that this is possible, if I not closed the
connection object properly, now just before this error, I created a page on
friday, where is use this piece of code 9 times in one ASP page (because the
select statement is always different..) is is possible that this is causing
the errors ??
<%strSQL = "SELECT * FROM ccd where left(ccd_filena me,3) = 'sop' and
ccd_generalPol = 1"
Set objRS = GetRecordset(st rConnection, strSQL)%>
<%do WHILE NOT objRS.EOF%>
GeneralPol.addI tem("<%=left(ri ght(objRS("ccd_ filename"),8),5 )%> <%=tri m
(objRS("ccd_tit le"))%>","<%res ponse.write(dir )%>/<%=trim(objRS(" ccd_filename
"))%>.<%=objRS( "ccd_filetype") %>","text");
<%objRS.MoveNex t
loop
objRS.close
%>
This is my connection file which is included in each ASP file.
------------------------------------------------------------
------------------------------------------------------------
<%
' FILE: ADORoutines.asp
' COMMON Include file containing ADO related routines
'----------------------------------------------------------------------
' Function: GetRecordSet
' Given a valid Connection String and a Valid SQL Statement, this
' Function returns a Disconnected Recordset
'----------------------------------------------------------------------
Function GetRecordSet(by val strConnectionSt ring, byval strSQL)
dim MdbFilePath
const adUseClient = 3
const adOpenForwardOn ly = 0
const adLockBatchOpti mistic = 4
' Create instance of connection object and then open the
' connection.
Dim objConn, objRS
Set objConn = Server.CreateOb ject("ADODB.Con nection")
strConnection =
"dsn=SQLConnect _Inventaris;uid =sa;pwd=pwd;DAT ABASE=be;APP=AS P Script"
objConn.Open strConnection
' Create instance of recordset object and open the
' recordset object against a table.
Set objRS = Server.CreateOb ject("ADODB.Rec ordset")
' Setting the cursor location to client side is important
' to get a disconnected recordset.
objRS.CursorLoc ation = adUseClient
objRS.Open strSQL, _
objConn, _
adOpenForwardOn ly, _
adLockBatchOpti mistic
' Disconnect the recordset.
Set objRS.ActiveCon nection = Nothing
' -- Close the connection
objConn.Close
set objConn = Nothing
' -- return the recordset
Set GetRecordSet = objRS
End Function
%>
Hope someone can help, I'm really stuck
TNGgroup
Im trying to build some simple ASP Pages for our Intranet, I'm not a
developer.. just try to do the best I can. for several days everything works
great until this morning, on all my ASP pages I get this Error messages.
Active Server Pages error 'ASP 0241'
CreateObject Exception
/ict/ta_overview.asp
The CreateObject of '(null)' caused exception C0000005.
Server object error 'ASP 0177 : c0000005'
Server.CreateOb ject Failed
/ADO_webcontent. asp, line 21
c0000005
My search on the net, learned me that this is possible, if I not closed the
connection object properly, now just before this error, I created a page on
friday, where is use this piece of code 9 times in one ASP page (because the
select statement is always different..) is is possible that this is causing
the errors ??
<%strSQL = "SELECT * FROM ccd where left(ccd_filena me,3) = 'sop' and
ccd_generalPol = 1"
Set objRS = GetRecordset(st rConnection, strSQL)%>
<%do WHILE NOT objRS.EOF%>
GeneralPol.addI tem("<%=left(ri ght(objRS("ccd_ filename"),8),5 )%> <%=tri m
(objRS("ccd_tit le"))%>","<%res ponse.write(dir )%>/<%=trim(objRS(" ccd_filename
"))%>.<%=objRS( "ccd_filetype") %>","text");
<%objRS.MoveNex t
loop
objRS.close
%>
This is my connection file which is included in each ASP file.
------------------------------------------------------------
------------------------------------------------------------
<%
' FILE: ADORoutines.asp
' COMMON Include file containing ADO related routines
'----------------------------------------------------------------------
' Function: GetRecordSet
' Given a valid Connection String and a Valid SQL Statement, this
' Function returns a Disconnected Recordset
'----------------------------------------------------------------------
Function GetRecordSet(by val strConnectionSt ring, byval strSQL)
dim MdbFilePath
const adUseClient = 3
const adOpenForwardOn ly = 0
const adLockBatchOpti mistic = 4
' Create instance of connection object and then open the
' connection.
Dim objConn, objRS
Set objConn = Server.CreateOb ject("ADODB.Con nection")
strConnection =
"dsn=SQLConnect _Inventaris;uid =sa;pwd=pwd;DAT ABASE=be;APP=AS P Script"
objConn.Open strConnection
' Create instance of recordset object and open the
' recordset object against a table.
Set objRS = Server.CreateOb ject("ADODB.Rec ordset")
' Setting the cursor location to client side is important
' to get a disconnected recordset.
objRS.CursorLoc ation = adUseClient
objRS.Open strSQL, _
objConn, _
adOpenForwardOn ly, _
adLockBatchOpti mistic
' Disconnect the recordset.
Set objRS.ActiveCon nection = Nothing
' -- Close the connection
objConn.Close
set objConn = Nothing
' -- return the recordset
Set GetRecordSet = objRS
End Function
%>
Hope someone can help, I'm really stuck
TNGgroup