cf道具领取助手:delphi如何用sql 语句动态建本地数据库表

来源:百度文库 编辑:神马品牌网 时间:2024/05/08 02:13:19

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');