p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 31st, 2009, 03:28 PM
Authorized User
Points: 202, Level: 4
Points: 202, Level: 4 Points: 202, Level: 4 Points: 202, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: , , .
Posts: 44
Thanks: 1
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old April 11th, 2009, 08:24 AM
Thearon's Avatar
Wrox Author
Points: 1,228, Level: 13
Points: 1,228, Level: 13 Points: 1,228, Level: 13 Points: 1,228, Level: 13
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 381
Thanks: 0
Thanked 6 Times in 6 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 05:04 AM
execute query without table!! al-hijjawi Classic ASP Databases 1 April 2nd, 2006 04: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 07:34 AM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM



All times are GMT -4. The time now is 02:26 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc