insert into 语法错误???
本帖最后由 LUPU163 于 2013-03-09 15:30:04 编辑 惭愧……又遇到问题了……
这个问题有很多人遇到过。有些是用了系统保留字。我就把代码贴出来吧
Set Cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Cn.CursorLocation = adUseClient
Cn.Open Cmd & ";Persist Security Info=False;"
cat.ActiveConnection = CmdH
Set tbl = New Table
tbl.Name = Dat & Model '表的名称
tbl.Columns.Append "Model & ID", adVarChar '表的第一个字段
tbl.Columns.Append "TIME1", adVarChar
tbl.Columns.Append "DATA1", adVarChar
tbl.Columns.Append "DATA2", adVarChar
cat.Tables.Append tbl
Set tbl = Nothing
Cn.Execute ("Insert into 130309AR882 (Model & ID,TIME1,DATA1,DATA2) values ('A201','we','we','we')")
Insert into [130309AR882] ([Model & ID],TIME1,DATA1,DATA2) values('A201','we','we','we')