You are not logged in.
Pages: 1
i know how to use bintohex,but can not use hextobin to convert RawUTF8 to TSQLRawBlob.
any one any help?
thanks.
Offline
What do you want to do exactly?
RawUTF8 is some UTF-8 encoded text
TSQLRawBlob is some blob of data - a RawByteString
Since RawByteString is a generic AnsiString, you can directly typecast TSQLRawBlob(aRawUTF8Var) if you really need to.
But be aware that you are starting to mix UTF-8 text and raw AnsiString: before Delphi 2009, there won't be any compiler warning so you may loose content.
Offline
thanks,
What i exactly want to do is:
load/save binary data(TMemoryStream,not only Tsynpicture) from/into database.
i used bintohex and hextobin to convert between binary and RawUTF8, and then load/save RawUTF8 from/into database,
sometimes i want to use TSQLRawBlob instead of RawUTF8...
Last edited by profh (2012-03-10 01:48:10)
Offline
Read the documentation about TSQLRawBlob fields: the framework is able to directly handle binary fields.
So it is not necessary to use RawUTF8 to exchange with the database.
Otherwise, TSQLRawBlob=RawByteString so it is directly usable with HexToBin.
Offline
Pages: 1