You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
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:
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.
You'll need to examine the data that you are trying to post. Does the data already exist in the database? Have you stepped through the code to ensure the data has been validated and the parameters are being set to what you expect?