Re: OLEDB errors when updating rows (that contain BLO B columns) using dynamic accessor

Mark Dawson <[email protected]> Tue, 2 Jul 2002 13:53:52 +0100
Newsgroups gmane.comp.windows.devel.oledb.devel
Message-ID <8F42A0DBFC56D6118CE100508B8B5A3F099AEF@SKYLLA>
Orest,

If you do nothing with the data returned by the provider and call SetData,
the privider will still release the BLOB that was present in the accessor.
This means that unless you then NULL that pointer, the CDynamicAccessor code
will attempt to delete it a second time.

I may be misunderstanding what you are asking, but if all you are trying to
do is leave the BLOB column unchanged during the SetData call then the
documented way of doing this is to set the column status for the BLOB column
to be DBSTATUS_S_IGNORE.  This will cause the provider to skip that column
in the SetData call and do nothing with it.  In this case the provider won't
release the BLOB either.

Does that answer your question?

Mark
--------------------------------------------------------------
Mark Dawson ([email protected])
Software Project Leader
Schenck Test Automation Ltd.
Lowesmoor Wharf, Worcester.
WR1 2RS. UK
+44 (0)1905 613361


-----Original Message-----
From: Orest Kulik [mailto:[email protected]]
Sent: 02 July 2002 13:46
To: [email protected]; Mark Dawson
Cc: Orest Kulik
Subject: Re: OLEDB errors when updating rows (that contain BLO B
columns) using dynamic accessor


Hi Mark,
thank you for the excellent tip, and yes, you are correct that this
behaviour is by the spec. I was thinking that binding does not work
properly (as we all witnesed in the past simillar behaviour). I tried to
satisfy that extra Release(), but what I should have done is ignoring it
completely. After purging my ISequentialStream ptrs to NULL, I have
discovered that I had originally two problems instead of only one.
The first problem emerged as the other was solved (with your tip).

Basically if I issue SetData, but without previously changing BLOB column,
SetData fails. Ir returns 0x8000ffff - catastrophic failure.
If I touch that data and change stream owner (from provider to 'client'),
now Update works and SetData returns S_OK. So I figured out that my
cursor/rowset OLE DB property set is not wrong. Do I have to do anything
prior to SetData, e.g. reading provider based stream and copying it
to 'client' stream? That would mean explicitly taking ownership over the
stream, true?

Orest Kulik
Ekobit, HR

_____________________________________________________________________
This message has been checked for all known viruses by UUNET delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.uk.uu.net/products/security/virus/

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.