我用access2000做好一个数据库aa,我想在一个工程中动态创建一个表bb。请问需要在工程中添加什麽控件连接到数据库aa,之后再怎样写代码动态创建一个表bb!我想动态的(form创建时)在窗体中创建多个edit控件,并且可以根据edit控件的多少来决定form的大小,请问如何实现,谢谢!

解决方案 »

  1.   

    请问create table bb(no char(4),name char(8));创建表的这一句应该写在哪里。我真的是不懂,请您再说一遍好吗
      

  2.   

    ADOQuery.Connection := ADOConnection;//ADOConnection 已经连接
    with ADOQuery do
    begin
      if Active then
        Active := False;
      SQL.Clear;
      SQL.Add('create table bb(no char(4),name char(8))';
      ExecSQL;
    end;
      

  3.   

    请问我想动态的(form创建时)在窗体中创建多个edit控件,并且可以根据edit控件的多少来决定form的大小,如何实现,谢谢!
      

  4.   

    也可以通过bde
    with query1 do
       begin
       sql.clear;
       sql.add('create table bb(no char(4),name char(8))');
       query1.execsql;
    end;
      

  5.   

    for i:=0 to 10 do
      begin
        button:=tbutton.create(self);
        button.top:=i*10+25;
      end;
    for i:=0 to form1.components.count-1 do
      if (form1.components[i] is tedit) then
        inc(editcount);
    form1.width:=editcount*100;//这里随便写
    form1.height:=editcount*100;//