我的目的是把 从theTemp_Talbe 的查询结果,导入到一个指定的表,并新建些表//   参数是 TableName   
ADOCommand1.CommandText := ' Select theTemp_Table.* '
                           + ' InTo TableName From theTemp_Table ';
   
   Adocommand1.Parameters[1].Name:=Name;
   
   //  参数TableName 的值 为字符变量 strName   
   ADOCommand1.Parameters.ParamByName('TableName').Value :=strName;ADOCommand1.Execute ;// 恳请大侠们, 帮我修改一下代码 OK 马上给分!  谢谢...

解决方案 »

  1.   

    ADOCommand1.CommandText := 'Create TabelName select * from theTemp_Table'
      

  2.   

    看看我做的一点东西,有源码,是用ADO做的
    www.100free.com/sduzjw
      

  3.   

      Adocommand1.CommandText:= 'declare @tablename varchar(30) ' +
                            '  set @tablename=:AAAB '  +
            ' exec('' select * into ''+ @tablename+'' from theTemp_Table  '')' ;  Adocommand1.Parameters.ParamByName('AAAB').Value:='AAAB';
      Adocommand1.Execute();
    我在机器上试过,这样可以。
      

  4.   

    楼上的大哥,我用的可是 Access 2000  的
      

  5.   

    procedure Form1.button1click(sender:Tobject);
    Var
      Tablename:String;
    begin
       Tablename:=Edit1.text;
       if tablename<>'' then 
         ADOCommand1.CommandText := ' Select theTemp_Table.* '
                               + ' InTo  '+TableName'+'  From theTemp_Table ';
       
      // Adocommand1.Parameters[1].Name:=Name;  不要了  ---刘阿木
       
       //  参数TableName 的值 为字符变量 strName   
     //ADOCommand1.Parameters.ParamByName('TableName').Value :=strName; --也不需要了 
    ADOCommand1.Execute ;
    end;
      

  6.   

    楼上的老兄,这样也是不行的错误信息是:
    Parameter 参数对象被不正确的定义。提供不一致或不完整的信息