Solved

Error 3426 when cancelling DB update

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 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