在delphi中如何建立SQL server 2000的数据库,如何建立表,请给出源码

解决方案 »

  1.   

    AdoQuery1.ConnectionString := 'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=master;Data Source=Fighter';
      //解释如下:数据库名为Fighter,用户ID:数据库为:master
      AdoQuery1.Close;
      AdoQuery1.SQL.Clear;
      AdoQuery1.SQL.add('create table sample (name char(10) not null, age int not null)');
      adoQuery1.ExecSQL;