[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Row-00001 Cannot allocate memory

Posted on 2003-12-04
6
Medium Priority
?
3,230 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
  • 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 Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

829 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