0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim sqlquery As String = "INSERT INTO Table1(Customer Name,Address,Contact Number,Type Of Customer)VALUES('" & TextBox1.Text & "', '" & TextBox2.Text & "', '" & TextBox3.Text & "','" & TextBox4.Text & "')"
Dim sqlcommand As New OleDbCommand
With sqlcommand
.CommandText = sqlquery
.Connection = con
.ExecuteNonQuery()
End With
MsgBox("ONE RECORD SUCCESFULLY ADDED :)")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
有人能幫助我嗎?它說在INSERT INTO語句中有一個錯誤,我不知道爲什麼。謝謝您的幫助。VB 2010 Express連接數據庫微軟訪問2010
感謝您的回答,它現在正在工作。非常感謝。 – Calixto 2014-09-05 21:15:34