473,941 Members | 7,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access validation rules -- how to handle updates to datatable

I have a vb .net 2003 app that uses access 2k as a backend. The main table
has some validation rules (legacy stuff brought forward inadvertantly, and
now we're stuck with 'em).

The problem is, I do a dataadaptor.upd ate, and an exception is thrown. I
would prefer to validate before the update & tell the user to fix the data.
dataset.hasErro rs does not detect the validation violation.

When the exception is thrown I can of course catch it, but the datarow is
somehow lost. Maybe if I knew what was happening here, I could recover the
row & let the user deal with it, but I haven't found the answer yet.

Help greatly appreciated!

Jeremy
Nov 21 '05 #1
5 3207
One little factoid: After an update attempt that fails due to validation
rule, the user corrects the data, attempts to save again, and now the
hasErrors property is True. Obviously left over from the previous attempt
to save.

How do I resolve this?

Jeremy
"Jeremy" <je****@ninprod ata.com> wrote in message
news:uu******** ******@TK2MSFTN GP15.phx.gbl...
I have a vb .net 2003 app that uses access 2k as a backend. The main table
has some validation rules (legacy stuff brought forward inadvertantly, and
now we're stuck with 'em).

The problem is, I do a dataadaptor.upd ate, and an exception is thrown. I
would prefer to validate before the update & tell the user to fix the
data. dataset.hasErro rs does not detect the validation violation.

When the exception is thrown I can of course catch it, but the datarow is
somehow lost. Maybe if I knew what was happening here, I could recover
the row & let the user deal with it, but I haven't found the answer yet.

Help greatly appreciated!

Jeremy

Nov 21 '05 #2
Jeremy,

Did you know that there is a rollback?

http://msdn.microsoft.com/library/de...lbacktopic.asp

I hope this helps?

Cor
Nov 21 '05 #3
Cor, I do understand transactions, but am not sure this is a solution to my
issue. The update is failing, and therefore there is nothing to rollback,
since nothing posted to start with.

My understanding of hasError is sketchy. Apparently, the update fails, sets
rowError (and therefore hasError). I send the data back to the user to
correct. They correct it, but the rowError is not automatically cleared.
It seems that I can set it to "" in a try/catch when the update fails. I'm
experimenting with this now.

Jeremy

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
Jeremy,

Did you know that there is a rollback?

http://msdn.microsoft.com/library/de...lbacktopic.asp

I hope this helps?

Cor

Nov 21 '05 #4
Jeremy,

My thought was that when you have catch an error (and than you know than
what), to do a rollback and than correct.

To tell you more about your problem you would at least show the update part,
because I don't know with what part of the dataset you are working.

Cor
Nov 21 '05 #5
Jeremy.

I forgot,

Catching and resolving errors should always have the approach that they are
seldom.

Therefore here maybe some more time to solve those, while the user will
normally accept that.

Just my thought,

Cor
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
8312
by: Phil Powell | last post by:
Where can I find an online PHP form validator script library to use? I have tried hacking the one here at work for weeks now and it's getting more and more impossible to customize, especially now with form elements that turn out to be arrays that have to be compared with one another! I have one form element, languages, a checkbox group. Beside each checkbox is a dropdown, proficiency (which will become proficiency alongside languages)....
21
3949
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email adresses and so on. I thought it might be a better way to programm an automated, dynamic form validation that works for all kinds of fields, shows the necessary error messages and highlights the coresponding form fields.
1
2863
by: Mike | last post by:
Note: My XML experience to date has (unfortunately) been limited to reading and thinking, rather than implementation. Anyway, I am in the process of trying to figure out the most efficient way to validate and transform some very large (potentially over 100MB) XML documents. This is related to another question I will post next, but for now, I want to focus on one particular topic. The data in question has particular business rules...
4
2972
by: Mike | last post by:
Related to another topic I just posted, I wanted to discuss ways to optimize the validation of very large (>100MB) XML documents. First, I have no idea if something like this already exists; it may even be the typical implementation for all I know. At any rate, it occurs to me that the set of business rules that need to be validated against an XML document represent a limited set of nodes at any given time (while parsing through the...
2
4047
by: qsweetbee | last post by:
I have a form(fAddUsers) in my database. It is continue form for data entry. Some fields are required fields. Some are optional fields. There is 1 particular filed(TokenExpirationDate)on the form which is depended on the other field(TokenID)whether it is blank or not. If the "TokenID" field is blank, the "TokenExpirationDate" field can be blank also. But if the "TokenID" field is not blank or null, the "TokenExpirationDate" field must be...
49
14403
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The application is relatively big: around 200 tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data (SQL Server 2000), 40 users. I'm wondering what are the disadvantages of using Access as front-end? Other that it's not...
7
3634
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
3
6011
by: Harlequin | last post by:
I must start this posing by making the point that I am NOT a VB programmer and I'm something of a Newbie to MS Access. I can program in a number of languages (Java, Javascript, PERL,PHP and TCL) but have never actually learnt VB so my request is that you bear this in mind if you plan on replying to this post. My request for help is as follows: I have an MS Access database in which one of the tables within it contains two date fields called...
14
1833
by: Luvin lunch | last post by:
Hi All, People keep saying things like "Access is a nightmare" or "Access is hell" but the only people I hear this from are peopel who aren't that experienced in using Access. The most I can tie these people down to is that Access isn't robust, that it only allows a few users and that the locking on it is terrible. I used it before for a single user worklist system and it was excellent. I'm now developing a system for a charity...
0
10134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9860
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4487
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.