Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Error 3426 when cancelling DB update

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
motorola
Asked:
motorola
  • 2
  • 2
1 Solution
 
vmpnCommented:
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
 
motorolaAuthor Commented:
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
 
vmpnCommented:
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
 
motorolaAuthor Commented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now