Solved

Error 3426 when cancelling DB update

Posted on 1997-06-15
4
283 Views
Last Modified: 2010-05-18
A simple VB4 form with a data control and a True DBGrid. The
data control is linked to a Jet database with one table. Adding and updating records from the DBGrid works fine. When I edit a record in the DBGrid and move the cursor to another record, the BeforeUpdate event is triggered in the DBGrid contol. At this point, if I choose to Cancel the update, by setting the Cancel variable in the BeforeUpdate event to True, it is here where I see the ugly Error 3426. It is triggered right after I leave the BeforeUpdate procedure code.

I also stepped through the VisData source code in debug mode and found the same problem when cancelling an update from the BeforeUpdate event procedure.

I know I can trap the error and prevent the information box
from telling me about the Error, but I would like to know exactly what the source is. Is the DBEngine issuing this Error 3426 ? I tried looking at the Error Collection object for the DBEngine, but it contained the same error information.

Any help is much appreciated !!


John McNally
0
Comment
Question by:motorola
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
vmpn earned 100 total points
ID: 1427295
This error is generated by DATA control. Error 3426 simply means that the user cancels the action or this happenes when DBGrid's BeforeUpdate event is set to Cancel = 1, canceling the action.

This is like the common dialog control is you set its CANCELERROR to True it will generate the ERROR message.  The only difference is that in DBGrid you can not turn it off.

Sincerely,
VMPN
0
 

Author Comment

by:motorola
ID: 1427296
I need some clarification. Do you mean the DBGrid cannot turn off the Error message generation of the Data Control ?  And how do I verify it's comming from the Data Control ?
0
 
LVL 3

Expert Comment

by:vmpn
ID: 1427297
As I know it you can not turn off generation of this error.  As to verifying it coming from Data when Err object has property "Source", it returns the name of the object that generated the error.

Sincerely,
VMPN
0
 

Author Comment

by:motorola
ID: 1427298
I checked out the Source property of the Errors object, and it listed "DAO.GenericObject" as the object causing the Error.  Do I assume the generic object is the Data Control ?
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month5 days, 23 hours left to enroll

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question