space is important, trycnn1.Execute "insert into " & tablenew.Name & " select * from bzsj where bzbh ='" & ffstr & "'"

解决方案 »

  1.   

    Dim sql As String
    Dim cnn1 As New ADODB.Connection
    cnn1.Open cnnstr 'cnnstr为连接窜'导入表结构及数据
    sql = "select * into new_tableA from bzsj where  bzbh ='" & ffstr & "'"
    cnn1.Execute sql'仅导入表结构
    sql = "select * into new_tableB from bzsj where 1 = 2 "
    cnn1.Execute sql
      

  2.   

    "insert into" & tablenew.Name & "select * from bzsj where bzbh 
    应在into后,select前加一空格,以和变量表名字符串分开,否则三个字符串就串在一起了,正确如下:
    "insert into " & tablenew.Name & " select * from bzsj where bzbh