建库用create database
procedure TForm1.btnCreateClick(Sender: TObject);
begin
ADOConnection1.Execute('CREATE DATABASE Sales'#13#10 +
'ON PRIMARY'#13#10 +
'( NAME = SPri1_dat,'#13#10 +
' FILENAME = ''F:/Test.mdf'','#13#10 +
' SIZE = 10,'#13#10 +
' MAXSIZE = 50,'#13#10 +
' FILEGROWTH = 15% )');
end;
procedure TForm1.btnDropClick(Sender: TObject);
begin
ADOConnection1.Execute('DROP DATABASE Sales');
end;
建表用create table
with query1 do
begin
sql.clear;
sql.add('create table tablename (aaa int,bbb int)');
ExecSQL;
end;