工业脱水机厂家:delphi如何用sql 语句动态建本地数据库表

来源:百度文库 编辑:高校问答 时间:2024/04/28 01:52:02

procedure TLoginData.createtable(filepath:shortstring);
var
st:Tstringlist;
begin
st:=Tstringlist.Create;
st.LoadFromFile(filepath);
with DataModule1.adoqry do
begin
Close;
SQL.Clear;
SQL.AddStrings(st);
ExecSQL;
end;
st.Free;
end;

执行createtable.sql脚本创建表

LoginData.createtable(extractfilepath(application.ExeName)+'\connection\createtable.sql');