Wrox Programmer Forums
|
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2009, 02:28 PM
Authorized User
 
Join Date: Aug 2005
Posts: 88
Thanks: 4
Thanked 0 Times in 0 Posts
Default 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.
 
Old April 11th, 2009, 07:24 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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?

What chapter, page and step are you on?

Thearon





Similar Threads
Thread Thread Starter Forum Replies Last Post
get the execute query result in variable mahen_pali SQL Server 2005 2 April 7th, 2008 04:04 AM
execute query without table!! al-hijjawi Classic ASP Databases 1 April 2nd, 2006 03:58 PM
Unable to execute query. rupen ASP.NET 1.0 and 1.1 Basics 1 February 27th, 2006 11:27 AM
connection.execute and command.execute difference vinod_yadav1919 Classic ASP Databases 0 September 28th, 2005 06:34 AM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.