INSERT INTO 语句的语法错误? 5

DBConnection.ConnectionString=DB_CnStr()DBConnection.Open()DimsqlAsNewSystem.Text.Str... DBConnection.ConnectionString = DB_CnStr()
DBConnection.Open()
Dim sql As New System.Text.StringBuilder
sql.Append("INSERT INTO [能量赋值_气源数据] ([日期],[CH4],[N2],[CO2],[C2H6],[C3H8],[H20],[H2S],[H2],[CO],[O2],[iC4H10],[nC4H10],[iC5H12],[nC5H12],[nC6H14],[nC7H16],[nC8H18],[nC9H20],[nC10H22],[He],[Ar],[温度],[压力],[站场名称],[流量],[测量热量],[记录人],[备忘信息])VALUES('" & _Date & "'," & _CH4 & "," & _N2 & "," & _CO2 & "," & _C2H6 & "," & _C3H8 & "," & _H20 & "," & _H2S & "," & _H2 & "," & _CO & "," & _O2 & "," & _iC4H10 & ", " & _nC4H10 & "," & _iC5H12 & "," & _nC5H12 & "," & _nC6H14 & "," & _nC7H16 & "," & _nC8H18 & ", " & _nC9H20 & "," & _nC10H22 & "," & _He & "," & _Ar & "," & _T & "," & _P & ",'" & _ZC & "'," & _Q & "," & _CHeat & ",'" & _UName & "','" & _BZ & "')")
Dim cmd As New OleDb.OleDbCommand(sql.ToString, DBConnection)
cmd.ExecuteNonQuery()-----------------------------这句报错INSERT INTO 语句的语法错误
DBConnection.Close()
End Function

Public Function DB_CnStr() As String
Return "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\data\GEMS.mdb;Jet OLEDB:Database Password=gasenergy"
End Function

Private Sub 气源信息录入_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
DateTimePicker1.CustomFormat = "yyyy-MM-dd hh:ss"
DateTimePicker1.Format = DateTimePickerFormat.Custom
End Sub
展开
 我来答
xingxingjiaoao
高粉答主

2019-12-03 · 百度翻译家,教师身份
xingxingjiaoao
采纳数:13729 获赞数:32662

向TA提问 私信TA
展开全部
insert into当中多了into,弃掉into就可以了。
因为insert是及物动词,直接接宾语,不需要介词。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式