Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert Varbytes to String?

Status
Not open for further replies.

topcat01

Programmer
Jul 10, 2003
83
GB
Hi Group,

I am using D7 and connecting to a SQL DB via ADO, one of the fields I am dealing with is stored as VARBYTES, it shows in the DBgrid as '(VARBYTES)' - I have tried to display this as a string using Tfields.gettext but I do not know enough about this data type and there isn't anything that helps me on Google. Can anyone provide any example or has anyone dealt with this type before?

TIA
 
From what I find, this is a variable array of bytes (TVarBytesField), the actual length of the array is found in the first two bytes.

So if I had to guess based on the examples I scared up, you would need to use TField.Getdata to put the field into a buffer, pick out the length of the data, and then use that to pull out the rest of the data, whatever shape or form that might take.

Something else that should be useful:



Measurement is not management.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top