我可以问一下吗,我在 INSERT INTO 语句中遇到语法错误。每当我按 ctrl+f5 时。我的代码有什么遗漏吗?
Protected Sub btnEnter_Click(sender As Object, e As System.EventArgs) Handles btnEnter.Click
Dim CID As Integer = CInt(lblCno.Text)
Dim tRentID As String = txtRentID.Text
Dim pList As String = ProductList.Text
Dim tDate As Date = lblDue.Text
Dim amount As Integer = CInt(txtAmount.Text)
Try
Dim dbconn1, dbcomm1, dbex1, sql1
dbconn1 = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("~/App_Data/aspDatabase.mdb"))
dbconn1.open()
sql1 = "Insert into order VALUES ( " & "'" & tRentID & "'" & "," & "'" & tDate & "'" & "," & "'" & amount & "'" & "," & "'" & CID & "'" & "," & pList & ")"
dbcomm1 = New OleDbCommand(sql1, dbconn1)
dbex1 = dbcomm1.executenonquery
dbconn1.Close()
Catch ex As Exception
lblOut.Text = ex.Message
End Try
End Sub
End Class