Pages

Wednesday, September 24, 2014

How to load sql file to ado command

Here is script to load sql file to adocommand at runtime.

var
f:TFileStream;
s:string;
begin
f:=TFileStream.Create('sql_commands.sql',fmOpenRead);
try
SetLength(s,f.Size);
f.Read(s[1],f.Size);
finally
f.Free;
end;
ADOCommand1.CommandText:=s;

No comments:

Post a Comment

Don't Forget To Join Our Community
×
Widget