Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > ADO Data > Memory leak in ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 4208 of 4320
Post > Topic >>

Memory leak in ado

by =?Utf-8?B?WmF6YSBUdXJtYW5pZHpl?= <ZazaTurmanidze@[EMAIL PROTECTED] Apr 14, 2008 at 01:53 AM

Hi,
I'm using ADO 2.7  and have memory leak when I try several times add and 
delete records.  See code (VB6)

Dim RS As ADODB.Recordset
Private Sub Main()
Dim counter As Long
    Set RS = New ADODB.Recordset
    RS.Fields.Append "Name", adVarChar, 255
    RS.Open , , , adLockOptimistic

    For counter = 1 To 100
        Add_Records
        Delete_Records
    Next
    MsgBox "Complete"
End Sub

Private Sub Add_Records()
    For counter = 1 To 10000
RS.AddNew "Name", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    Next
End Sub

Private Sub Delete_Records()
    counter = RS.RecordCount
    If counter = 0 Then Exit Sub
    RS.MoveLast
    Do Until RS.BOF = True
        RS.Delete
        RS.MovePrevious
    Loop
End Sub
 




 4 Posts in Topic:
Memory leak in ado
=?Utf-8?B?WmF6YSBUdXJtYW5  2008-04-14 01:53:01 
Re: Memory leak in ado
"Bob Barrows [MVP]&q  2008-04-14 06:54:13 
Re: Memory leak in ado
=?Utf-8?B?WmF6YSBUdXJtYW5  2008-04-14 04:51:00 
Re: Memory leak in ado
"Bob Barrows [MVP]&q  2008-04-14 08:45:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:35:17 CST 2008.