Easy Question....Probably
I am using the follwing code to insert things into a Access 2003 DB:
Code:
Dim strSQL As StringBuilder
Dim strconn As String
Dim connection As New OleDb.OleDbConnection
strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbplace
connection.ConnectionString = strconn
connection.Open()
Dim command As New OleDb.OleDbCommand
command.Connection = connection
command.CommandText = "INSERT Into ocuff1(ocuff1,CYCLE_RAT_1_ID,session_id ) Values ('" & rat1ocuff.ToString & "'," & CYCLE_RAT_1_ID & ",'" & cycleid & "')"
command.ExecuteNonQuery()
Is there an easy way to see or to verify that this is completed?
In other words I want to know that it is done before I move on.
Thanks,
Bebandit
Re: Easy Question....Probably
Quote:
Originally posted by bebandit
Is there an easy way to see or to verify that this is completed?
In other words I want to know that it is done before I move on.
Is there a specific reason you want to check on the state of the operation? That is, is your next step dependent on those values being inserted? If so, there is often a lag between running a command and access updating for update/insert/delete statements - you can often receive a message that the statement has run successfully but not see the value in access for some [relatively short] amount of time.
Also, running cmd.ExecuteNonQuery() returns an integer value of rows affected - -1 indicating an error.