Updating binary fields in MS SQL
- From: "Jonathan Neve[Microtec]" <jonathan@xxxxxxxxxxx>
- Date: 15 Jan 2007 00:23:06 -0800
Hi,
I'm using a TADOCommand to update a binary ("image") field in an MS SQL
table. I have an update statement with a parameter, and I set the
binary value to the parameter.
The trouble I have is that the binary data is getting deformed. After
every byte of binary data, a byte of 0s is inserted. For example, I set
the parameter to 0x54657374 (that is, 'Test'), and it actually put into
the database 0x5400650073007400.
Has anyone else ever had a problem like this, and do you have any idea
where it's coming from? Here's how I set my parameter:
ADOCommand.Parameters.Items[i].Value := NewVal;
where NewVal is a Variant, and in debug mode, I made sure it had the
correct value (i.e. 'Test').
After that, I do:
resultSet := ADOCommand.Execute(nRowsAffected, EmptyParam);
And I put the resultset into an ADODataSet (but of course, since here
I'm dealing with an update statement, this part has no effect).
Any ideas?
--
Best regards,
Jonathan Neve
_______________
CopyTiger - advanced database replicator for Interbase/Firebird!
Web : http://www.microtec.fr/copycat/ct
_______________________________________
CopyCat - database replication components for Delphi/C++Builder!
Web : http://www.microtec.fr/copycat/cc
.
- Follow-Ups:
- Re: Updating binary fields in MS SQL
- From: Mike Shkolnik
- Re: Updating binary fields in MS SQL
- Prev by Date: Re: Multiple Memo fields to TRichEdit
- Next by Date: Re: Updating binary fields in MS SQL
- Previous by thread: Multiple Memo fields to TRichEdit
- Next by thread: Re: Updating binary fields in MS SQL
- Index(es):
Relevant Pages
|