Solved

Error 3426 when cancelling DB update

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 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