I use the MS Access database as the base of my VB.NET application. I entered user data into the database using the INSERT INTO statement:
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & config("DatabasePath") & ";") cn.Open() cmd = New OleDbCommand("INSERT INTO blah blah blah...", cn) dr = cmd.ExecuteReader
Everything works, but I wanted to check if the data was actually entered into the database. I tried using:
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & config("DatabasePath") & ";") cn.Open() cmd = New OleDbCommand("INSERT INTO blah blah blah...", cn) dr = cmd.ExecuteReader If dr.Read() Then ' Blah End If
but obviously, the insert statement does not return anything, so this will not work. Any suggestions?
Dox
source share