ADOQ.SQL.Add('');
在括號里加上下面語句應該可以了﹐pubss改為你要建的數據庫。
我在Delphi7 + SQL Server 2000下測試通過。
Use master
If Not Exists(Select name From sysdatabases Where name = 'pubss')
Begin
Create Database pubss
On
( Name = 'pubss_dat',
FileName = 'D:/mydoc/pubssdat.mdf',
Size = 10,
MaxSize = 50,
FileGrowth = 5 )
Log On
( NAME = 'pubss_log',
FILENAME = 'D:/mydoc/pubsslog.ldf',
Size = 5,
MaxSize = 25,
FileGrowth = 5 )
End