?
Solved

Row-00001 Cannot allocate memory

Posted on 2003-12-04
6
Medium Priority
?
3,158 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
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!

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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 …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

770 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