SetBlobData and GetData syntax
Posted: Wed 03 Jan 2007 00:54
Hi
I have 16-byte field defined as 'MD5Digest: array [0..15] of byte' in Delphi and defined as 'Binary(16)' in the table.
This is how I set parameter in TMSQuery (when I do Insert):
qryMD5.ParamByName('MD5').SetBlobData(@MD5Digest, SizeOf(MD5Digest));
This is how I read that value later from the table (using another TMSQuery):
qryGetMD5.FieldByName('MD5').GetData(@MD5Digest);
It seems that I am getting correct results.
Is this correct? If not, what is the proper syntax? In Insert statement can I use SetData(pointer) instead of SetBlobData(pointer, length)?
D2006, latest SDAC version, MSSQL 2005.
Thanks
Zoran
I have 16-byte field defined as 'MD5Digest: array [0..15] of byte' in Delphi and defined as 'Binary(16)' in the table.
This is how I set parameter in TMSQuery (when I do Insert):
qryMD5.ParamByName('MD5').SetBlobData(@MD5Digest, SizeOf(MD5Digest));
This is how I read that value later from the table (using another TMSQuery):
qryGetMD5.FieldByName('MD5').GetData(@MD5Digest);
It seems that I am getting correct results.
Is this correct? If not, what is the proper syntax? In Insert statement can I use SetData(pointer) instead of SetBlobData(pointer, length)?
D2006, latest SDAC version, MSSQL 2005.
Thanks
Zoran