Article View: borland.public.cppbuilder.database.ado
Article #127Blobs
From: Vivmt
Date: Tue, 09 Oct 2007 08:32
Date: Tue, 09 Oct 2007 08:32
37 lines
2251 bytes
2251 bytes
Please, can anyone tell me how to get data into an MSAccess blob field (i.e.
OLE Object field)?
The descriptions of TADOBlobStream all sound wonderful, but I just can't get
it to work, and I can't find any working examples in C++ anywhere. The only
example I can find in the C++ Builder 6 help is the method below,
Here is the latest two methods I have tried:
DM1->ADOCapture->BeginTrans(); // ADOCapture is the connection -
dsCapture is a table dataset on it
DM1->dsCapture->Append(); // add a new record
DM1->dsCapture->FieldValues["fldName"] = sName; // update the name
field
// Now try and pdate the BLOB field
// Method 1
// TADOBlobStream *BlobStream = new TADOBlobStream
((TBlobField*)DM1->dsCapture->FieldByName("fldLabelEMF"), bmReadWrite );
// Method 2
TStream *BlobStream =
DM1->dsCapture->CreateBlobStream(DM1->dsCapture->FieldByName("fldLabelEMF"),
bmReadWrite);
BlobStream->Write(EMFBuf, lEMFBufLen);
DM1->dsCapture->Post();
DM1->ADOCapture->CommitTrans();
delete BlobStream;
Both methods get to the "delete BlobStream" line and gives the message
"Dataset not in edit or insert mode". The record was added to the table,
but the blob field is empty.
I'm running out of hair to tear out!! Please help!
Technical Details
Message-ID:
<470b3ca0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,9f13f8bf38683b27,start X-Google-Attributes: gid10698b,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Vivmt" <westgatemt@hotmail.com> From: "Vivmt" <westgatemt@hotmail.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Blobs Date: Tue, 9 Oct 2007 09:32:32 +0100 Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 84.69.69.117 Message-ID: <470b3ca0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1191918752 84.69.69.117 (9 Oct 2007 01:32:32 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail