BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MySQL binary fields

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Max Wright
Guest





PostPosted: Fri Jun 16, 2006 6:06 pm    Post subject: MySQL binary fields Reply with quote



What is the best way to read and write fields defined as BINARY in
MySQL?

I am using the BDE with MySQL's ODBC driver. The fields are identified
by BCB(4) as TStringFields, but reading and writing via AsString doesn't
work if the data contains zero-value bytes.

I've also tried using instances of TBinaryField and TBytesField but when
I do this I get a "type mismatch for field 'data', expecting: Unknown
actual: FixedChar."

I can translate the binary data into a character string that can be used
in SQL insert or update statement, and this gets the correct data into
the database, but all attempts to get it out again fail at the first
zero byte.

Am I missing something obvious here?

- Max Wright
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.