Solved

Error 3426 when cancelling DB update

Posted on 1997-06-15
4
259 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
  • 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now