Article View: borland.public.cppbuilder.database.ado
Article #3830ADO and Blobs
From: Paul McBryde
Date: Wed, 05 Jun 2002 05:10
Date: Wed, 05 Jun 2002 05:10
34 lines
2195 bytes
2195 bytes
I am trying to write a Blob to an ADO in C++ Builder 5. The BlobStream
is operating fine and I have verified that my data is written to it.
But following a Post command, which should send it to the ADO, the
BlobStream is not entered into the database. The field where it should
be is empty. Here is an extract of one of the many methods I have
tried:
TADOBlobStream *lStream = NULL;
lStream = (TADOBlobStream*)
pTrendTable->CreateBlobStream(pTrendTable->FieldByName(MPWM_PARAM_TREND),bmReadWrite);
int lNo = 0;
while (fgets(lTitle.c_str(), lTitle.Length(), lFileStream)!=NULL)
{
// Store param value as short int in blob-stream
short int num = (short int) lList->Strings[np].ToInt();
lStream->Write(&num, sizeof(short int));
lNo++;
}
pTrendTable->FieldByName(MPW_SYSTEM_ID)->AsString = lSystem_ID;
pTrendTable->FieldByName(MPW_STUDY_ID)->AsString = lStudy_ID;
pTrendTable->FieldByName(MPW_PATIENT_NO)->AsInteger = lPatient_No;
pTrendTable->FieldByName(MPWM_SESSION_ID)->AsInteger = lSession_ID;
pTrendTable->FieldByName(MPWM_PARAM_ID)->AsInteger = np + 1;
pTrendTable->FieldByName(MPWM_PARAM_NAME)->AsString =
lColumnNames->Strings[np];
pTrendTable->Post();
Values are posted to all the above fields except the BlobField. I
am using Microsoft Jet 4.0 OLE DB Provider and Microsoft Access.
If anyone can help, it would be greatly appreciated.
Cheers,
Paul
Technical Details
Message-ID:
<f0bc2e16.0206042109.4bd91ac@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,3a9669049a275428,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-04 22:10:00 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: funkahedron@hotmail.com (Paul McBryde) Newsgroups: borland.public.cppbuilder.database.ado Subject: ADO and Blobs Date: 4 Jun 2002 22:10:00 -0700 Organization: http://groups.google.com/ Lines: 34 Message-ID: <f0bc2e16.0206042109.4bd91ac@posting.google.com> NNTP-Posting-Host: 210.9.177.26 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1023253800 14344 127.0.0.1 (5 Jun 2002 05:10:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Jun 2002 05:10:00 GMT