🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
5 messages
5 total messages Started by Gheorghe Wed, 28 Dec 2005 21:02
ADO & BLOB
#572
Author: Gheorghe
Date: Wed, 28 Dec 2005 21:02
21 lines
1582 bytes
Hi,

I'm trying to read a Memo field in a MS Access DB, using BCB6 and ADOQuery.
I constantly get the size of the blob as 1 byte, no matter what technique I
use.
Any ideas?

Here's the code
=====================================
aCon->ConnectionString = "Provider=MSDASQL.1;DSN=MS Access
Database;DBQ=dbPath;DefaultDir=dbdir;DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;PWD=password";
aCon->Open();

aQuery->SQL->Clear();
aQuery->SQL->Add("SELECT BLOBFIELD FROM TABLE;");
aQuery->Open();

TBlobField * bfield = (TBlobField *) aQuery->FieldByName("BLOBFIELD");
int len = bfield->Size;        // This is always 1
=======================================
Re: ADO & BLOB
#573
Author: Viatcheslav V. Vassiliev
Date: Thu, 29 Dec 2005 08:52
40 lines
2238 bytes
Try to use Jet OLEDB provider. Connection string is:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mydb.mdb;

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + 
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Gheorghe" <gmusca@dnt.ro> ???????/???????? ? ???????? ?????????: 
news:43b2fa90@newsgroups.borland.com...
> Hi,
>
> I'm trying to read a Memo field in a MS Access DB, using BCB6 and 
> ADOQuery.
> I constantly get the size of the blob as 1 byte, no matter what technique 
> I
> use.
> Any ideas?
>
> Here's the code
> =====================================
> aCon->ConnectionString = "Provider=MSDASQL.1;DSN=MS Access
> Database;DBQ=dbPath;DefaultDir=dbdir;DriverId=25;FIL=MS
> Access;MaxBufferSize=2048;PageTimeout=5;PWD=password";
> aCon->Open();
>
> aQuery->SQL->Clear();
> aQuery->SQL->Add("SELECT BLOBFIELD FROM TABLE;");
> aQuery->Open();
>
> TBlobField * bfield = (TBlobField *) aQuery->FieldByName("BLOBFIELD");
> int len = bfield->Size;        // This is always 1
> =======================================
>
>
> 
Re: ADO & BLOB
#576
Author: Gheorghe
Date: Mon, 02 Jan 2006 09:06
79 lines
3639 bytes
I have already tried JET OLEDB, result is the same.
I had similar problems in a C# project, which was solved by the following
approach:

==============================================================
    OdbcConnection conn = new OdbcConnection();;
    conn.connectionStringFormat = "Driver = {{Microsoft Access Driver
(*mdb).....";
    OdbcCommand  comm = new OdbcCommand("select blob from table;", conn);

    conn.Open();
    OdbcDataReader dr =
comm.ExecuteReader(CommandBehavior.SequentiialAccess);
    dr.Read();

    long retVal = dr.GetBytes(columnIndex, startIndex, buffer, 0,
bufferSize);
    // etc.
================================================================
It seems that the problem comes from the text interpretation of the BLOB
field (which was in fact a Memo in Access, tha contains also some Unicode
strings mixed with binaries).

Unfortunately, I can't find the equivalent technique in BCB (reading chunks
of bytes from a BLOB in a buffer, thus bypassing any conversion that might
apear).








"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:43b3a360$1@newsgroups.borland.com...
> Try to use Jet OLEDB provider. Connection string is:
>
> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mydb.mdb;
>
> //------------------------------------------
> Regards,
> Vassiliev V. V.
> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> ADO.Net
> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> MS Jet (Access) and Interbase (through OLEDB)
>
> "Gheorghe" <gmusca@dnt.ro> ???????/???????? ? ???????? ?????????:
> news:43b2fa90@newsgroups.borland.com...
> > Hi,
> >
> > I'm trying to read a Memo field in a MS Access DB, using BCB6 and
> > ADOQuery.
> > I constantly get the size of the blob as 1 byte, no matter what
technique
> > I
> > use.
> > Any ideas?
> >
> > Here's the code
> > =====================================
> > aCon->ConnectionString = "Provider=MSDASQL.1;DSN=MS Access
> > Database;DBQ=dbPath;DefaultDir=dbdir;DriverId=25;FIL=MS
> > Access;MaxBufferSize=2048;PageTimeout=5;PWD=password";
> > aCon->Open();
> >
> > aQuery->SQL->Clear();
> > aQuery->SQL->Add("SELECT BLOBFIELD FROM TABLE;");
> > aQuery->Open();
> >
> > TBlobField * bfield = (TBlobField *) aQuery->FieldByName("BLOBFIELD");
> > int len = bfield->Size;        // This is always 1
> > =======================================
> >
> >
> >
>
>
Re: ADO & BLOB
#578
Author: Gheorghe
Date: Tue, 03 Jan 2006 12:31
40 lines
2243 bytes
I forgot to mention that the 1 byte that I get when reading the BLOB (Memo)
is 0x3F ('?').
The same happens when trying to manually Copy and Paste the content of the
Memo field directly from Access.
Isn't this some Windows way of signaling the impossibility to interprete the
content?

Any help/hint would be appreciated,
Thanks



"Gheorghe" <gmusca@dnt.ro> wrote in message
news:43b2fa90@newsgroups.borland.com...
> Hi,
>
> I'm trying to read a Memo field in a MS Access DB, using BCB6 and
ADOQuery.
> I constantly get the size of the blob as 1 byte, no matter what technique
I
> use.
> Any ideas?
>
> Here's the code
> =====================================
> aCon->ConnectionString = "Provider=MSDASQL.1;DSN=MS Access
> Database;DBQ=dbPath;DefaultDir=dbdir;DriverId=25;FIL=MS
> Access;MaxBufferSize=2048;PageTimeout=5;PWD=password";
> aCon->Open();
>
> aQuery->SQL->Clear();
> aQuery->SQL->Add("SELECT BLOBFIELD FROM TABLE;");
> aQuery->Open();
>
> TBlobField * bfield = (TBlobField *) aQuery->FieldByName("BLOBFIELD");
> int len = bfield->Size;        // This is always 1
> =======================================
>
>
>
Re: ADO & BLOB
#579
Author: Mark Guerrieri
Date: Tue, 03 Jan 2006 19:54
50 lines
2401 bytes
Try using TADOBlobStream to read the data from the field...

Mark

"Gheorghe" <gmusca@dnt.ro> wrote in message
news:43ba6b7e@newsgroups.borland.com...
> I forgot to mention that the 1 byte that I get when reading the BLOB
(Memo)
> is 0x3F ('?').
> The same happens when trying to manually Copy and Paste the content of the
> Memo field directly from Access.
> Isn't this some Windows way of signaling the impossibility to interprete
the
> content?
>
> Any help/hint would be appreciated,
> Thanks
>
>
>
> "Gheorghe" <gmusca@dnt.ro> wrote in message
> news:43b2fa90@newsgroups.borland.com...
> > Hi,
> >
> > I'm trying to read a Memo field in a MS Access DB, using BCB6 and
> ADOQuery.
> > I constantly get the size of the blob as 1 byte, no matter what
technique
> I
> > use.
> > Any ideas?
> >
> > Here's the code
> > =====================================
> > aCon->ConnectionString = "Provider=MSDASQL.1;DSN=MS Access
> > Database;DBQ=dbPath;DefaultDir=dbdir;DriverId=25;FIL=MS
> > Access;MaxBufferSize=2048;PageTimeout=5;PWD=password";
> > aCon->Open();
> >
> > aQuery->SQL->Clear();
> > aQuery->SQL->Add("SELECT BLOBFIELD FROM TABLE;");
> > aQuery->Open();
> >
> > TBlobField * bfield = (TBlobField *) aQuery->FieldByName("BLOBFIELD");
> > int len = bfield->Size;        // This is always 1
> > =======================================
> >
> >
> >
>
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