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 

Binary data using TQuery

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





PostPosted: Fri Jun 09, 2006 9:27 pm    Post subject: Binary data using TQuery Reply with quote



Hi-

I am trying to set binary data into a SQL Server 2000 database table. I'm
using a varbinary field in the database. I have not been having any luck in
trying to set the binary data in. Does anyone know how to do it?

I have tried TParam->AsString, but this will truncate the data inserted as
soon as a null character is found in the binary data. Attempted AsBlob, but
my 39 bytes turned into 255 when read out???

Any suggestions? I currently have my binary data stored in an AnsiString,
which handles binary data fine.

Thanks,
Mark
Back to top
Mark Brown
Guest





PostPosted: Fri Jun 09, 2006 10:07 pm    Post subject: Re: Binary data using TQuery Reply with quote



I think I found a solution. I changed the database field to be of type
"image", and used AsBlob to set the data just fine. When I read the data
back out with AsString, everything is as it should be.

Hope this helps someone in the future,
Mark
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.