Help. ADO VB6 Oracle9i Stored Procedure Call Leaks Memory

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

DRWilcox

Thread Starter
Joined
Feb 7, 2003
Messages
2
I've got a VB6 Application that uses ADO 2.7 to create a recordset object from a stored procedure. I'm using the MSDAORA.1 OLEDB Driver. The procedure is run on a timer every few seconds. The program is growing in increments of 4k every 4 or 5 times the recordset is created. I've simplified the code to just running the recordset over and over using a timer to eliminate everything else and it still grows so I believe that I've isolated it to this piece of code. I've tried it against Oracle 9.0.1 and 8.0.5.
Is ADO Leaking or am I doing something wrong?
I would appreciate any help anyone could give me on this.


Here is the code:

Public Function GET_NEXT_BATCH() As Double
Dim lBatchID As Double
Dim parBUID As ADODB.Parameter
Dim com As ADODB.Command
Dim RS As ADODB.Recordset
Dim Connection As ADODB.Connection

On Error GoTo eh
Set Connection = GetConnection
Set RS = New ADODB.Recordset
Set com = New ADODB.Command

With com
Set .ActiveConnection = Connection
.CommandType = adCmdStoredProc
.CommandText = "DWILCOX.PKG_ATTRIBUTE.GET_ATTRIB_BY_AID"
Set parBUID = .CreateParameter("p_BUID", _
adDouble, adParamInput)
.Parameters.Append parBUID
End With

With RS
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly
End With

parBUID.Value = 1

Set RS = com.Execute(, , adAsyncFetch)

If RS.EOF Then
lBatchID = 0.1 'SET_NEXT_BATCH()
Else
RS.MoveFirst
lBatchID = RS.Fields(0)
End If

GET_NEXT_BATCH = lBatchID

' clean house
RS.Close
Connection.Close
Set RS = Nothing
Set com = Nothing
Set Connection = Nothing

Exit Function
eh:
RS.Close
Connection.Close

Set RS = Nothing
Set com = Nothing
Set Connection = Nothing

MsgBox Err.Number & " " & Err.Description

End Function

Regards
 
Joined
Jul 29, 2001
Messages
21,334
Is the stored procedure closing properly or is it opening a new instance of the SP before the prvious one has completly been cleaned up?
 

DRWilcox

Thread Starter
Joined
Feb 7, 2003
Messages
2
Every time the timer fires it turns itself off until the SP call is complete, I don't believe there is anyway that it can get called again before it completes.
I'm going to try to rewrite the SP to return a single value instead of a recordset and see if that works. I've heard that if a SP Call returns an error or just some message such as "No Data Found", ADO does not clean that up and it leaks.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top