• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4101
  • Last Modified:

Row-00001 Cannot allocate memory

Dear all,

We have a question in database programming with Visual Basic and Oracle 8i.

We are using stored procedures(grouped into packages) to get data from the database using the OraOLEDB provider.
We return resultsets from the stored procedures to VB.

During a long operation (lot of calls to different stored procedures) the returned recordset has rs.EOF = True but the request should return some rows.

Inspecting the returned recordset we realized that the "Row-00001 Cannot allocate memory" error was thrown.

Is there any way to know where the error comes from?

Usefull info:
-OraOledb provider on Oracle
-MDAC 2.8 Used
-The error is always produced at a different point in the application
-No error trace appears at server side
-CursorSide = adUseServer

  • 5
  • 4
1 Solution
Take a look here:


and please show us your connection code.

BusinessVisionSSAuthor Commented:

I've already readed it, but this post does not aply to my problem as I always use early binding with the ADODB. prefix.

Anyway here is the the connection string:

Provider=OraOLEDB.Oracle.1;Password=ADI1;Persist Security Info=True;User ID=ADI1;Data Source=JULIUS;Extended Properties=""

PLSQLRSet parameter is changed at the ADODB.Command

I've tried also with CacheType=File but I still have the problem.

Could you also show the code block where you are calling the package.  The more you can show the easier it will be to track this down.

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

BusinessVisionSSAuthor Commented:
The error appears on different stored procedures call (not always the same), I paste some code calling one of them

Dim m_oCmd As ADODB.Command
Dim m_oRs As ADODB.Recordset
Dim rs As ADODB.Recordset
Dim OI AS clsOI

    On Error GoTo Err_Handler
    'Create new ADODB.Command objetc and initialize it
    Set m_oCmd = New ADODB.Command
    Set m_oCmd.ActiveConnection = Parent.Connection
    m_oCmd.CommandText = "BVM.C_REV"
    m_oCmd.Prepared = True
    m_oCmd.CommandType = adCmdStoredProc
    m_oCmd.Properties("PLSQLRSet") = True

    'Input parameters
    With m_oCmd.Parameters
                .Append m_oCmd.CreateParameter("I_1", adVarChar, adParamInput, 3000, I_C)
                .Append m_oCmd.CreateParameter("I_2", adVarChar, adParamInput, 255, I_I)
                .Append m_oCmd.CreateParameter("I_3", adVarChar, adParamInput, 32, I_U)
                .Append m_oCmd.CreateParameter("I_4", adInteger, adParamInput,, I_P)
                .Append m_oCmd.CreateParameter("I_5", adVarChar, adParamInput, 3000, I_PT)
                .Append m_oCmd.CreateParameter("I_6", adVarChar, adParamInput, 3000, I_V)
    End With

        Set rs = m_oCmd.Execute
        Set OIS= New clsOIS
        While Not rs.EOF                        '<-------------- HERE rs.EOF = TRUE but should be FALSE
            Set OI= GetSession.RSFactory.GetOI_RS(rs)
            OIS.Add OI

        'OI Properties Recordset
        Set m_oRs = rs.NextRecordset
        OIS.LoadProperties_RS m_oRs, PreLoad
        Set m_oRs = Nothing
        Set rs = Nothing
Try switching to client side cursor for your connection.


BusinessVisionSSAuthor Commented:
I can not use client side cursor due performance and I don't use the .Recordcount property.
Remeber the code is executed perfectly thousands of times and at some point it stops working.
RecordCount -1 is just a symptom of the issue, it would not matter if you use it or not. How big are the recordsets you are returning?  It should not hit your performance that much unless the recordsets are really huge.

Have you tried running this without the Command object, but strictly with Recordset?

BusinessVisionSSAuthor Commented:
It depends, from 0 to 2000 rows, but changing the cursor side to client side really affects the performance.

Without the Command and with bind variables,How to do it?

Is there any way to measure the memory consumed by the OraOleDB on the client? If we can measure it maybe we can know where to look at.

>but changing the cursor side to client side really affects the performance.

Have you tested it?

>Without the Command

Dim m_oRs As ADODB.Recordset
Dim rs As ADODB.Recordset
    On Error GoTo Err_Handler
    strSQL = "Exec BVM.C_REV '" & I_C & "', '" &  I_I & "', '" & I_U & "', '" & I_P & "', '" & I_PT & "', " & I_V & "'"
     Set rs = New ADODB.Recordset
     rs.Open strSQL, Parent.Connection, adOpenStatic, adLockOptimisstic
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now