🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Read an mssql varbinary feild from an ADO query?

#1428
From: Chemile
Date: Tue, 20 Jul 2004 21:55
25 lines
1909 bytes
I've been trying to figure out how to read from a varbinary field for quite
some time without any luck.  Some of the symbols return as question marks.
I'm using Borload C++ Builder 6 and ADO components.  I did figure out how to
update a field in hexadecimal.

    pQuery->Close();
    pQuery->SQL->Clear();
    pQuery->SQL->Add("insert into tablename (key,binfield) values
('1',0x"+hexVal+")");
    pQuery->ExecSQL();

I also figured a way around it that worked for a while.  I used "IdHTTP1" to
download a php webpage that returned the fields data.  But once a field got
larger then 256 bytes that stopped working.

I've heard that blobs do not work with varbinary fields.  I'm not sure if
that is true, but I haven't been able to retrieve it as a blob.

TADOBlobStream *Stream = new
TADOBlobStream((TBlobField*)pQuery->Fields->Fields[0],bmRead);

Is there a way to return a query in hexadecimal or in a stream so that
extended character info is saved?  Should I change components?

Thanks
Technical Details
Message-ID: <40fd95b4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,78c5f45d66599a8f,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Chemile" <chemile@qwest.net>
From: "Chemile" <chemile@qwest.net>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Read an mssql varbinary feild from an ADO query?
Date: Tue, 20 Jul 2004 15:55:47 -0600
Lines: 27
Organization: Avoc Studios
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.0
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.132
NNTP-Posting-Host: 67.171.116.3
Message-ID: <40fd95b4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090360756 67.171.116.3 (20 Jul 2004 14:59:16 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail