Error on ASP page C0000005

Discussion in 'ASP General' started by TNGgroup, Sep 6, 2004.

  1. TNGgroup

    TNGgroup Guest

    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_filename"),8),5)%>&nbsp;<%=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
     
    TNGgroup, Sep 6, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chuck
    Replies:
    0
    Views:
    266
    Chuck
    Jul 5, 2003
  2. Som
    Replies:
    2
    Views:
    609
    Aaron Bertrand [MVP]
    Mar 6, 2004
  3. Divya
    Replies:
    2
    Views:
    196
    Bullschmidt
    May 11, 2004
  4. wk6pack
    Replies:
    14
    Views:
    443
    Bob Barrows [MVP]
    Sep 30, 2004
  5. David Lozzi

    ScriptEngine threw exception 'C0000005'

    David Lozzi, Aug 23, 2005, in forum: ASP General
    Replies:
    0
    Views:
    256
    David Lozzi
    Aug 23, 2005
Loading...

Share This Page