Solved

Row-00001 Cannot allocate memory

Posted on 2003-12-04
6
3,002 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Author Comment

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

Accepted Solution

by:
leonstryker earned 250 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now