Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages
Started by Vivmt
Tue, 09 Oct 2007 08:32
Blobs
Author: 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!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads