the problem is the following: in edit1 i have a filename taken from opendialog1. now i want to insert that file into a table called TABLE1, in the column SOLUTIONS. the falues of this column are alreadu definded as BLOB type.
function FileToString(const AFilename:string):string;
var
LSize:integer;
LStream:TStream;
begin
{Code a combinaton of TStrings.ReadFromFile and TStrings.ReadFromStream}
LStream:=TFileStream.Create(AFilename,fmOpenRead or fmShareDenyWrite);
try
LSize:=LStream.Size;
SetString(Result, nil, LSize);
LStream.Read(Pointer(Result)^, LSize);
finally
LStream.Free;
end;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.