Solved

Runtime error "Out of Memory" -2147024882(8007000e)':

Posted on 2000-05-18
9
3,834 Views
Last Modified: 2013-12-25
I'am getting this runtime error when resources seem to be good.
75-85%

I have checked MSDN and KB FOR All available articles.
q168354  etc..
I was wondering if anyone else has experienced this error. and possible resolutions.

I have noticed it is basically occuring on a combox drilldown sequence.
This is a repeated selection occuring in the application.

The comboxes are unbound. Using code to connect.


I have fixed a cursor location (I think) problem.
I'am not in an c/s environment.
So I was using  "adUseServer"
Switched to "adUseClient"

I have not fully tested  with this fix but,  hope it may be part of the problem.

Looking for good possible solution and past experience.
Thanks
fordraiders


0
Comment
Question by:fordraiders
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 18

Expert Comment

by:mdougan
ID: 2822589
Does this occur when you are filling any combo boxes?  There is a limit of 32,000 items in a combo box (probably 32767).

Are you calling any procedures recursively?  Does one combo_click event set the listindex of another combo?  This will cause a click event in that combo, and if that combo sets the listindex in the first combo, you'll have an endless loop.

Are you generating any dynamic arrays?  If so, I think that there is a limit of about 64K of memory that can be allocated to dynamic Strings.

If it is happening on a database query, what is the total row length of the rows you are returning.  ODBC has some limits on total row length.

Try doing a Select count(*) instead of your regular query to see how many rows you're getting back.  If you're getting too many, maybe you're blowing out the limit of a combo box or grid that you're loading with the results.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2825335
I got this error when i tried to play around with stored procedures:
* trying to execute a stored procedure i don't have the permission
* trying to execute a stored procedure i don't have the permission on the underlying table(s)
* trying to apply values of invalid range or type

Hope this helps
0
 
LVL 3

Author Comment

by:fordraiders
ID: 2825684
mDougan,
1. No
2. No, No
3. No
4. 21 rows

angelIII
I'am still in ADO 2.0


Does anyoe think the cursor connectionn set to
AdUseServer would effect this.
I'am not in a Multi-user situation.
fordraiders



0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2825764
The version of ADO did not matter with this problem in my case...
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 2827820
Typically this is caused by a cascade event. You have a self referencing sub that is recursively calling itself until it runs out of stack.

For example if you load something into a control in the controls _Change event you'll trigger a cascade. Loading the control fires the _Change event that loads the control that fires the _Change event that...

This type of problem is fairly simple to debug. Throw Debug.Print statements as the first line in each subroutine and event code. Have it print the routine name. You'll see the routine that's causing the problem fire off messages by the zillion until it crashes.

Once you've narrowed it down to a specific routine set a breakpoint at the entry and <F8> (single step) thru it. You'll see the event retrigger.

Sometimes the program will *NOT* crash during single step. This is a harder nut to crack. This is usually caused by a timing race on some events. Subtler to debug.

VB executes events when it can. It round robin executes control events. So if you are running in the debug environment a background event may be completing in time for the slower single step code to run. But when you compile and run at full speed the timing margins drop and events may be firing in unexpected sequences.

M
0
 
LVL 3

Author Comment

by:fordraiders
ID: 2834154
Mark2150,
In my combobox,
I call a new adodb connection.
I set the rs =  nothing
db  =  nothing
This calls combox2 click event.

 from here this fires off this event to opena new adodb connection plus fill a datagrid depending on combo selections.


Do I need to type anything other than

cboNoun_Click()
debug.print cboNoun

.......
cboMod_click()
debug.print cboMod
.......

Thanks
fordraiders

0
 
LVL 12

Expert Comment

by:mark2150
ID: 2834459
You need "s around the statements like this:

debug.print "cboNoun"

What event in your combo box is clearing the database connection?

You shouldn't have to clear and rebuild the DB connection.

Is the combo *bound* to the database? If so then you're closing the db and then opening the db that fires a change that closes the db that opens the db that fires a change that....

Let me see the actual code and let us know what the database properties of the control are set to...

M
0
 
LVL 3

Author Comment

by:fordraiders
ID: 2834886
Mark 2150
Here is the Form Load event which loads the First combox.

Events:
Formloads  cboNoun

Click event on cboNoun fires to cboMod(combobox2)
Events fire on cboMod click.

I think this is where I'am getting a memory leak or as you say I keep rebuilding a stack event.

CODE:
Private Sub Form_Load ()
' form load for cboNoun event  combobox drilldown started
    Dim adoconnection As ADODB.Connection
    Dim adorecordset As ADODB.Recordset
    Dim connectstring As String
    Set adoconnection = New ADODB.Connection
    Set adorecordset = New ADODB.Recordset
    connectstring = "Provider=Microsoft.Jet.OLEDB.3.51;" _
                     & "Data Source=C:\program files\MYDATA\data\DATA.mdb"
    adoconnection.Open connectstring

    'NEW ROUTINE FOR TEXT ID'S 110399
    adorecordset.Open "nouns", adoconnection

     'NEW ROUTINE FOR TEXT ID'S 110399
    Do Until adorecordset.EOF
        cboNoun.AddItem adorecordset!NOUN
        adorecordset.MoveNext
    Loop
    adorecordset.Close
    adoconnection.Close
    Set adorecordset = Nothing
    Set adoconnection = Nothing
adodc1.Recordset.Sort = "FLDTEST ASC"
exit sub

Private Sub cboNoun_Click()
Debug.Print "cboNoun"
    Dim db As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim sql As String
    ' clearing modifier combox if after Noun is chosen
    Me.cboMod.Clear
    With db
        .CursorLocation = adUseClient
        .ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source =c:\program files\MYDATA\data\DATA.mdb"
        .Open
    End With
' TRY INDEX CODE
sql = "Select * from ndxNounsModifiers where noun = '" & cboNoun.Text & "' ORDER BY NOUN"
    With rs
        .Open sql, db
    End With
    Do Until rs.EOF = True
        cboMod.AddItem rs.Fields("modifier").Value
        rs.MoveNext
    Loop
 Debug.Print db
    rs.Close
    Set rs = Nothing
    db.Close
    Set db = Nothing
Text2.Text = cboNoun.Text
End Sub

Private Sub cboNoun_DropDown()
cboMod_Click
End Sub


Private Sub cboMod_Click()
Debug.Print cboMod
Dim cnNN As ADODB.Connection
Dim rsTT As ADODB.Recordset
Dim STRCNN As String
Dim STRSQL As String
Dim tgValue As String
Dim X As String
X = "LENGTH"
Me.Command2.Enabled = True
' provide jet connection
    STRCNN = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source =c:\program files\MYDATA\data\DATA.mdb"
    Set cnNN = New ADODB.Connection
cnNN.Open STRCNN
    ' hook it all up guys new code from one table  DATA  stuff
    STRSQL = "Select Attribute, Value from ndxAttributes " & _
          "where noun = '" & cboNoun.Text & _
          "' and modifier = '" & cboMod.Text & "'"
  '        "where noun = '" & cboNoun.List(cboNoun.ListIndex) & _
  '        "' and modifier = '" & cboMod.List(cboMod.ListIndex) & "'"
Set rsTT = New ADODB.Recordset
    With rsTT
        .ActiveConnection = cnNN
        .CursorLocation = adUseClient
        .CursorType = adOpenKeyset
        .LockType = adLockOptimistic
        .Open STRSQL, , , , adCmdText
    End With
  Set Adodc3.Recordset = rsTT
 Set DataGrid1.DataSource = Adodc3.Recordset
 DataGrid1.Columns(0).Locked = True
End Sub

Thanks
fordraiders

0
 
LVL 3

Author Comment

by:fordraiders
ID: 2849784
Comment accepted as answer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 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…

758 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

24 Experts available now in Live!

Get 1:1 Help Now