Re: ADO record update
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Mon, 2 Apr 2007 23:55:14 +0100
I'm having a performance problem with the following line of code:
TESTHR(m_adoBindPtr->Update(m_pAccountDataTable));
It's in a loop that runs in a fraction of a second without it and runs in
30
seconds with it included. The loop executes this line about 3000 times.
The
only field changed is a text field of 20 character max. The loop includes
the
binding of a new record on each pass...
Why?
I bind records once and then reuse the same struct/class over and over
again.
Seems nonsensical to keep binding on per-loop-iteration.
...and interogates 2 of the fields.
Below are some selected lines from other areas of the code to help
identify
the base classes etc. :
IADORecordBindingPtr m_adoBindPtr;
inline void TESTHR(HRESULT _hr) { if FAILED(_hr)
_com_issue_error(_hr); }
class CAccountDataBindingADO : public CADORecordBinding
Doesnt mean anything. You might have we as said
int i;
:
:
for (; ; ++i) // <= this increment is slow, why?
I suggest you give a _COMPLETE_ compileable example that is slow and then
there is something to examine.
Merely mentioning a few lines of your code is not enough to narrow things
down.
(and I tend to think that those programmers who display just 2 lines of code
almost like fish entrails and have the incredible expectations that you will
be able to diagnose _EXACTLY_ what is wrong from just those 2 lines - well
they cant be the sharpest knife in the drawer).
Any ideas why the "Update" method takes so long to execute???
No. You have probably done something incorrect but it will be the code you
dont mention.
Cheers
Stephen Howe
.
- Follow-Ups:
- Re: ADO record update
- From: Neil B
- Re: ADO record update
- Prev by Date: Re: Error No 3712; Operation has been cancelled by the user
- Next by Date: Re: Return value from Stored Procedure
- Previous by thread: Re: Error No 3712; Operation has been cancelled by the user
- Next by thread: Re: ADO record update
- Index(es):
Relevant Pages
|
|