Been struggling with this one for a while. We have a old table (SQL Server) that has image type data. I want to get the text.
So far this is what I've done.
- Try to convert or cast it (not allowed)
- Try to bring over the data into delphi by calling a SP (I got to the point of having the data assigned to a variant)
- Looked into a RTF to text function (found something here on SO, if i can just get the image data into a string).
This is the code I have so far. It's attached to a button click for now (will be running in a service). I think the assignment to the report var is not right, and SetString may not be right either. I'm not even sure if i am going about this the right way.
var
report: array of byte;
s: string;
begin
ADOStoredProc1.Parameters.ParamByName('@EncounterID').Value := '7';
ADOStoredProc1.Open;
while not ADOStoredProc1.EOF do
begin
report := ADOStoredProc1.FieldByName('Report').Value;
SetString(s, PAnsiChar(@report[0]), length(report));
Memo1.Lines.Add(s);
ADOStoredProc1.Next;
end;