title: SQL INSERT INTO statement for MS Access
body: <p>I am trying to learn how to use MS Access with my VB.net program.  I am practicing learning how to use the INSERT INTO statement but I keep getting an error.  </p>
  
  <p>Here is my code:</p>
  
  <pre><code>Imports System.Data.OleDb
  
  Public Class Form1
  
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim myConnection As OleDbConnection
      Dim DBpath As String = "C:\Documents and Settings\nordeen1\Desktop\Test.mdb"
      Dim sConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" &amp; DBpath &amp; ";Persist Security Info=True"
      myConnection = New OleDbConnection(sConnectionString)
      myConnection.Open()
      Dim SQLstr As String
      SQLstr = "INSERT INTO Test (Text, [Date], Number) VALUES ('testing', #2/6/1990#, 5)"
      Dim cmd As New OleDbCommand(SQLstr, myConnection)
      cmd.ExecuteNonQuery()
  End Sub
  End Class
  </code></pre>
  
  <p>I get this error "OleDbException was unhandled.  Syntax error in INSERT INTO statement." at <code>cmd.ExecuteNonQuery()</code></p>
  
  <p>Any suggestions are greatly appreciated! Thanks!</p>