title: I cannot save new row into Microsoft Access Database via Visual Basic
body: <p>This code works elsewhere in my program but in this form it is no longer working. I have come with the error</p>
  <pre><code>System.Data.OleDb.OleDbException: 'Syntax error in INSERT INTO statement.'
  </code></pre>
  <p>This errors happens at the point</p>
  <pre><code>da.Update(ds, &quot;EmployeeTable&quot;)
  </code></pre>
  <p><strong>The rest of the code is below</strong></p>
  <pre><code>Imports System.Data.OleDb
  'Allows an connection of a type of Database to VB
  Public Class frmAdmin
      ReadOnly dbConnection As New OleDb.OleDbConnection
      'Declares a variable that will handle the connection to Visual Basic
      ReadOnly ds As New DataSet
      'Declares the variable that will handle the datasets from the record
      Dim da As OleDb.OleDbDataAdapter
      'This declares the variable that will handle the data adapted that connects to the Database to VB
      Dim sql As String
      'A string that will handle SQL which tells the location of data
  
  Private Sub BtnNewEmp_Click(sender As Object, e As EventArgs) Handles btnNewEmp.Click
  
          Dim strProvider As String
          Dim strSource As String
          Dim strConnString As String
  
          strProvider = &quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source =&quot;
          strSource = &quot;../FuelAgencyDataBase.accdb&quot;
          strConnString = strProvider &amp; strSource
          dbConnection.ConnectionString = strConnString
  
          dbConnection.Open()
  
          sql = &quot;SELECT * FROM EmployeeTable&quot;
          da = New OleDbDataAdapter(sql, dbConnection)
          da.Fill(ds, &quot;EmployeeTable&quot;)
  
          dbConnection.Close()
  
          For Each row In ds.Tables(&quot;EmployeeTable&quot;).Rows
              Dim Test As String = (row.item(1)) &amp; &quot; &quot; + (row.item(2)) &amp; &quot; - &quot; &amp; (row.item(6))
              lbxHours.Items.Add(Test)
          Next
  
          Dim cb As New OleDbCommandBuilder(da)
          'Variable handles how Visual Studio connects to the database
          Dim dsNewRow As DataRow
          'Variable handles how new rows are added to the record
  
          dsNewRow = ds.Tables(&quot;EmployeeTable&quot;).NewRow()
          dsNewRow.Item(1) = StrFirstName + &quot; &quot; + StrLastName
          dsNewRow.Item(2) = StrUsername
          dsNewRow.Item(3) = StrPassword
          dsNewRow.Item(4) = StrProfession
  
          ds.Tables(&quot;EmployeeTable&quot;).Rows.Add(dsNewRow)
  
          da.Update(ds, &quot;EmployeeTable&quot;)
          MsgBox(&quot;Employee has been added into the database&quot;)
      End Sub
  </code></pre>
  <p>I have a live connection to the database as other code has connected to the database. The table name is called &quot;EmployeeTable&quot;. Can anybody else please find a solution to this error?</p>