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.CreateObject 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_filename,3) = 'sop' and
ccd_generalPol = 1"
Set objRS = GetRecordset(strConnection, strSQL)%>
<%do WHILE NOT objRS.EOF%>
GeneralPol.addItem("<%=left(right(objRS("ccd_filen ame"),8),5)%> <%=trim
(objRS("ccd_title"))%>","<%response.write(dir)%>/<%=trim(objRS("ccd_filename
"))%>.<%=objRS("ccd_filetype")%>","text");
<%objRS.MoveNext
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(byval strConnectionString, byval strSQL)
dim MdbFilePath
const adUseClient = 3
const adOpenForwardOnly = 0
const adLockBatchOptimistic = 4
' Create instance of connection object and then open the
' connection.
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection =
"dsn=SQLConnect_Inventaris;uid=sa;pwd=pwd;DATABASE =be;APP=ASP Script"
objConn.Open strConnection
' Create instance of recordset object and open the
' recordset object against a table.
Set objRS = Server.CreateObject("ADODB.Recordset")
' Setting the cursor location to client side is important
' to get a disconnected recordset.
objRS.CursorLocation = adUseClient
objRS.Open strSQL, _
objConn, _
adOpenForwardOnly, _
adLockBatchOptimistic
' Disconnect the recordset.
Set objRS.ActiveConnection = 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