Re: Huge memory comsumption of ADODB Connection object
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 26 Nov 2007 11:49:38 -0500
Kevin LZJ wrote:
controlHi all,Basically - stop using the cursor in your procedure. It's not necessary.
I encountered such a problem: ADODB Connection comsumes huge
memory before it is closed.
I use VB to port some data from EXCEL file into SYBASE database.
For some reason, I first convert the EXCEL file to DBASE format, then
use ADO Data Control to get data from DBASE file, finally, i use
ADODB to insert data into SYBASE database (using ADODB provider from
SYBASE corp). The problem is, I use a database stored procedure
to insert data in
which there is a cursor to check whether same data is existing. If the
content of cursor is more than 300 items, I found the memory used
increases greatly (in my case, there are about 600 data items in the
cursor, causing the memory used up to more than 2GB and getting error
for the lack of memory). After some research, I found 2 points :
1). If I delete the cursor from the Stored Procedure, my app uses
memory normally.
2). Only when the ADODB connection is closed, can the huge memory
used be freed.
So, my question is: why the ADODB connection object uses such huge
memory even the stored procedure is running in the server? And, how
can I get this problem worked out?
BTW, in my environment, the SYBASE Database Server also runs on my
laptop as well as the VB app does.
You will need to post this in a Sybase group to get the correct syntax,
but in SQL Server I would do this:
IF EXISTS (SELECT * FROM table WHERE ...)
UPDATE table ...
ELSE
INSERT table (...
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: Huge memory comsumption of ADODB Connection object
- From: Kevin LZJ
- Re: Huge memory comsumption of ADODB Connection object
- Prev by Date: Re: Best Practices for DataAccess Layer in VB6
- Next by Date: Re: Huge memory comsumption of ADODB Connection object
- Previous by thread: Re: Fill typed dataset with one stored procedure call
- Next by thread: Re: Huge memory comsumption of ADODB Connection object
- Index(es):
Relevant Pages
|