🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #576

Re: ADO & BLOB

#576
From: 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
> > =======================================
> >
> >
> >
>
>
Technical Details
Message-ID: <43b8e9fa@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43b2fa90@newsgroups.borland.com> <43b3a360$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,2a73d595005f452e
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Gheorghe" <gmusca@dnt.ro>
From: "Gheorghe" <gmusca@dnt.ro>
Newsgroups: borland.public.cppbuilder.database.ado
References: <43b2fa90@newsgroups.borland.com> <43b3a360$1@newsgroups.borland.com>
Subject: Re: ADO & BLOB
Date: Mon, 2 Jan 2006 11:06:18 +0200
Lines: 80
MIME-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 193.231.117.201
Message-ID: <43b8e9fa@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1136191994 193.231.117.201 (2 Jan 2006 00:53:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail