insert into 语句语法错误,怪问题!!大家来看看。
For i = 0 To txtbzbh.ListCount - 1
ffstr = txtbzbh.List(i)
jjstr = "tmpbzsj" & i
Dim tablenew As New Table
With tablenew
.Name = jjstr
.columns.Append "bzbh", adVarWChar, 10
.columns.Append "field_name", adVarWChar, 14
.columns.Append "field_show", adVarWChar, 50
.columns.Append "bzmin", adDouble
.columns.Append "bzmax", adDouble
.columns.Append "unit", adVarWChar, 7
.columns.Append "note", adVarWChar, 2
.columns.Append "yylb", adVarWChar, 50
.columns.Append "gclb", adVarWChar, 50
End With
cat1.Tables.Append tablenew ''到这儿不出错。下面这一句就报错。
cnn1.Execute "insert into" & tablenew.Name & "select * from bzsj where bzbh ='" & ffstr & "'"
Next
说是insert into语句语法错,我不知错在那儿。请各位指正。
我如改成下面语句则不报错。
cnn1.Execute "insert into tmpsj select * from bzsj where bzbh ='" & ffstr & "'"
其中,tmpsj是已存在的表。