title: Insert new records into a table with Visual Basic using OLEDBConnection
body: <p>I'm using Visual Basic 2010 Express and Access 2003.
  I'm trying to make sql querys to the mdb file. I'm using OLEDBConnection. The Select query works fine, but I can't insert rows in the table. Here is the code.</p>
  
  <pre><code>    Dim connStr As String = "provider=Microsoft.Jet.OLEDB.4.0;data source=" &amp; System.IO.Directory.GetCurrentDirectory() &amp; "\tpv.mdb;" 
      Dim con As New OleDb.OleDbConnection(connStr)
      con.Open()
      Dim query As String = "select * from Productos"
      Dim cmd As New OleDb.OleDbCommand(query, con)
      Dim reader As OleDb.OleDbDataReader
      reader = cmd.ExecuteReader
      While reader.Read()
          MsgBox(reader.GetValue(0) &amp; ", " &amp; reader.GetValue(1) &amp; " , " &amp; reader.GetValue(2))
      End While
      reader.Close()
      query = "insert into Productos (NombreProducto,PrecioCoste) VALUES ('cana',4)"
      Dim cmd2 As New OleDb.OleDbCommand(query, con)
      cmd.ExecuteNonQuery()
      con.Close()
  </code></pre>
  
  <p>Why the INSERT query does not work?</p>