Query Does Not Execute
I am using "Beginning Visual Basic 2005 Databases" as my guiding source of information and have come across a strange occurrence that I can not get past.
I am using Visual Basic 2008 Express and writing a timekeeping program. Due to the number of tables involved there are three separate "Insert Into" routines. Two work perfectly. The third procedure runs through to completion but doesn't do anything.
In my efforts to find out why I came across a "strange" situation at the following lines of code:
1) objData.OpenConnection()
2) intRowsAffected = objData.Command.ExecuteNonQuery
3) objData.CloseConnection()
I set a break point at each of these lines which showed that
With the break point at 1) the integer intRowsAffected showed 1
With the break point at 2) the integer intRowsAffected showed 1 (before execution of this line of code)
With the break point at 3) the integer intRowsAffected showed 0 (before execution of this line of code)
This would seem to indicate that the execution of 2) caused the change, and the update did not execute.
I have checked every line of code for the parameters and every item in the query and all are correct and I don't know what caused the error or how to fix it.
Any help would rally be appreciated.
|