Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Row-00001 Cannot allocate memory

Posted on 2003-12-04
6
Medium Priority
?
3,196 Views
Last Modified: 2007-12-19
Dear all,

I have a question in database programming with VB and Oracle 8i.

During I use VB to retrieve a large field record (the field size about 5000 varchar2). The program will be occurred error "ROW-00001 Cannot allocate memory".

But there are no error during retrieving little size field record.

I am using:
-- VB6
-- Oracle 8i OLDDB Provider

Thanks,
Daniel
0
Comment
Question by:wongchun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 9904350
Can I see your connection and recordset code please.

Leon
0
 
LVL 1

Author Comment

by:wongchun
ID: 9910193
'=============================================
' Function for get connection
'=============================================
Public Function open_dbconnect() As Connection

On Error GoTo errorhandler

Dim na_conn As ADODB.Connection
Set na_conn = CreateObject("ADODB.Connection")

na_conn.ConnectionString = "Provider=OraOLEDB.Oracle;" & _
                          "Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = " & v_host & ")(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = " & v_dbname & ") ) );" & _
                          "User ID=" & v_dbuser & ";" & _
                          "Password=" & v_dbpassword & ";" & _
                          "PLSQLRSet=1;"


na_conn.Open
Set open_dbconnect = na_conn

Exit Function

errorhandler:

    MsgBox "Fail to connect to database"

End Function

'=============================================
' Program
'=============================================
Set na_conn = open_dbconnect
   
        Dim param_return_status As ADODB.Parameter
        Dim param_bank_code As ADODB.Parameter
        Dim param_corp_id As ADODB.Parameter
        Dim param_lang As ADODB.Parameter
        Dim na_cmd As ADODB.Command
           
        Set na_cmd = New ADODB.Command
        Set recset = New ADODB.Recordset
       
        If recset.State <> 0 Then
            recset.Close
        End If

        Set param_bank_code = na_cmd.CreateParameter("param_bank_code", adVariant, adParamInput, 4, Bankcode)
        Set param_corp_id = na_cmd.CreateParameter("param_corp_id", adVariant, adParamInput, 10, Trim(rtfCorpIdSearch.Text))
        Set param_return_status = na_cmd.CreateParameter("param_return_status", adSmallInt, adParamOutput)
       
        ' Get the Corporate Name
        na_cmd.CommandText = "{CALL pkg_admin.sp_get_corp_details(?, ?, ?)}"
       
        na_cmd.Parameters.Append param_bank_code
        na_cmd.Parameters.Append param_corp_id
        na_cmd.Parameters.Append param_return_status
       
        na_cmd.ActiveConnection = na_conn
        Set recset = na_cmd.Execute
       
        ......
       
        Set na_cmd = Nothing
       
        recset.Close
        Set recset = Nothing
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 9912041
Change:
Set na_conn = CreateObject("ADODB.Connection")

To:
Set na_conn = New ADODB.Connection

Also change:
Public Function open_dbconnect() As Connection

To
Public Function open_dbconnect() As ADODB.Connection

Leon
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:wongchun
ID: 9932610
Are they different?
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 1000 total points
ID: 9932630
You are mixing Late and Early Binding terminology.  If you wish to use Early binding then establish a reference to ADO and declare as:

Dim na_conn As ADODB.Connection
Set na_conn = New ADODB.Connection

If you are using Late Binding.  Then:

Dim na_conn As Object
Set na_conn = CreateObject("ADODB.Connection")

In the declaration you are better off declaring objects exactly as they are. By declaring "open_dbconnect() As Connection" you may be limiting your methods since it is a different object.

Leon
0
 
LVL 1

Author Comment

by:wongchun
ID: 9970649
Thanks.

Daniel
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question