Inserting Data Into MS Access 2010 Database Using VB2017

  • Thread starter Thread starter Developer Dude
  • Start date Start date
D

Developer Dude

Guest
I am trying to insert data into an MS Access 2010 Database using an interface written in VB2017. I am able to enter and

save data but it doesn't display until I close the database and re-open it. I understand that MS Access does not process

a combination "Insert" and "Select" together.

This is what I have so far:

Private Sub Insert_Command_SE()

'Create An OleDb Command To Insert Service Data.
SE_InsertCommand.Connection = cnPSB
SE_InsertCommand.CommandType = CommandType.Text

strSE_InsertCommand = "INSERT INTO SE (SE_KEY, SE_NAME, SE_ST, SE_JT) VALUES (@SE_KEY, @SE_NAME, @SE_ST, @SE_JT)"

SE_InsertCommand.CommandText = strSE_InsertCommand
SE_InsertCommand.Parameters.Add("@SE_KEY", OleDbType.VarChar, 14, "SE_KEY")
SE_InsertCommand.Parameters.Add("@SE_NAME", OleDbType.VarChar, 60, "SE_NAME")
SE_InsertCommand.Parameters.Add("@SE_ST", OleDbType.VarChar).Value = "Type 1"
SE_InsertCommand.Parameters.Add("@SE_JT", OleDbType.VarChar).Value = "Type A"


End Sub


Any help would be appreciated.

Thanks,


John

Continue reading...
 
Back
Top