title: Missing Select Keyword for Insert Statement
body: <p>I have the following code in VBA and whenever I try to run it, I get an error message saying "missing select keyword".</p>
  
  <p>I don't see why it even wants a select keyword when I don't want to read anything, I only want to write to the database:</p>
  
  <pre><code>Private Sub SubmitButton_Click(sender As System.Object, e As System.EventArgs) Handles          SubmitButton.Click
      SubmitButton.Enabled = False
  
      DeliveryDateTimePicker.CustomFormat = "yyyyMMdd"
      Dim sysdate As Date = Date.Now
      Dim XConnStr As String = "DSN=ivr.dsn; SERVER=ivr.dsn.world; UID=user; PWD=password;"
  
      Dim SQLString As String = "INSERT INTO sv.ivr_resched ([ORDER_NO], [PHONE_NO], [REQUESTED_DELIVERY_DATE], [RESCHEDULE_REASON], [CREATE_DATE], [CREATE_USERID], [IN_PROGRESS], [STATUS]) VALUES (@ORDER_NO, @PHONE_NO, @REQUESTED_DELIVERY_DATE, @RESCHEDULE_REASON, @CREATE_DATE, @CREATE_USERID, @IN_PROGRESS, @STATUS);"
      Dim objXConn As New OdbcConnection(XConnStr)
      Dim objCommand As New OdbcCommand(SQLString, objXConn)
  
      objCommand.Parameters.AddWithValue("@ORDER_NO", MSTextBox.Text)
      objCommand.Parameters.AddWithValue("@PHONE_NO", PhoneTextBox.Text)
      objCommand.Parameters.AddWithValue("@REQUESTED_DELIVERY_DATE", DeliveryDateTimePicker.Value)
      objCommand.Parameters.AddWithValue("@RESCHEDULE_REASON", ReasonComboBox.SelectedValue)
      objCommand.Parameters.AddWithValue("@CREATE_DATE", sysdate)
      objCommand.Parameters.AddWithValue("@CREATE_USERID", TransferID)
      objCommand.Parameters.AddWithValue("@IN_PROGRESS", "N")
      objCommand.Parameters.AddWithValue("@STATUS", "newrecrd")
      Try
          Using objXConn
              objXConn.Open()
              objCommand.ExecuteNonQuery()
              objXConn.Close()
          End Using
          MsgBox("Success")
          MSTextBox.Text = ""
          PhoneTextBox.Text = ""
          ReasonComboBox.SelectedValue = ""
          DeliveryDateTimePicker.Value = Date.Now
      Catch ex As Exception
          MessageBox.Show("Error: " &amp; ex.ToString)
      End Try
  
      SubmitButton.Enabled = True
  
  End Sub
  </code></pre>
  
  <p>Any help you can provide will be appreciated.</p>
  
  <p>Issue has been resolved, here is the working code:</p>
  
  <pre><code>    Private Sub SubmitButton_Click(sender As System.Object, e As System.EventArgs) Handles SubmitButton.Click
      SubmitButton.Enabled = False
      Dim sysdate As Date = Date.Now
      Dim XConnStr As String = "DSN=ivr.dsn; SERVER=ivr.dsn.world; UID=user; PWD=password;"
      Dim SQLString As String = "INSERT INTO sv.ivr_resched (ORDER_NO, PHONE_NO, REQUESTED_DELIVERY_DATE, RESCHEDULE_REASON, CREATE_DATE, CREATE_USERID, IN_PROGRESS, STATUS) VALUES(?, ?, ?, ?, ?, ?, ?, ?)"
      Dim objXConn As New OdbcConnection(XConnStr)
      Dim objCommand As New OdbcCommand(SQLString, objXConn)
  
      objCommand.Parameters.Add("ORDER_NO", OdbcType.Char)
      objCommand.Parameters.Item("ORDER_NO").Value = MSTextBox.Text
      objCommand.Parameters.Add("PHONE_NO", OdbcType.Char)
      objCommand.Parameters.Item("PHONE_NO").Value = PhoneTextBox.Text
      objCommand.Parameters.Add("REQUESTED_DELIVERY_DATE", OdbcType.Char)
      objCommand.Parameters.Item("REQUESTED_DELIVERY_DATE").Value = DeliveryDateTimePicker.Value.ToString("yyyMMdd")
      objCommand.Parameters.Add("RESCHEDULE_REASON", OdbcType.Char)
      objCommand.Parameters.Item("RESCHEDULE_REASON").Value = ReasonComboBox.SelectedValue
      objCommand.Parameters.Add("CREATE_DATE", OdbcType.Date)
      objCommand.Parameters.Item("CREATE_DATE").Value = sysdate
      objCommand.Parameters.Add("CREATE_USERID", OdbcType.Char)
      objCommand.Parameters.Item("CREATE_USERID").Value = TransferID
      objCommand.Parameters.Add("IN_PROGRESS", OdbcType.Char)
      objCommand.Parameters.Item("IN_PROGRESS").Value = "N"
      objCommand.Parameters.Add("STATUS", OdbcType.Char)
      objCommand.Parameters.Item("STATUS").Value = "NEWREC"
  
      Try
          Using objXConn
              objXConn.Open()
              objCommand.ExecuteNonQuery()
              objXConn.Close()
          End Using
          MsgBox("Success")
          MSTextBox.Text = ""
          PhoneTextBox.Text = ""
          ReasonComboBox.SelectedValue = ""
          DeliveryDateTimePicker.Value = Date.Now
      Catch ex As Exception
          MessageBox.Show("Error: " &amp; ex.ToString)
      End Try
  
      SubmitButton.Enabled = True
  
  End Sub
  </code></pre>