473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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.update, and an exception is thrown. I
would prefer to validate before the update & tell the user to fix the data.
dataset.hasErrors 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 3149
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****@ninprodata.com> wrote in message
news:uu**************@TK2MSFTNGP15.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.update, and an exception is thrown. I
would prefer to validate before the update & tell the user to fix the
data. dataset.hasErrors 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**************@tk2msftngp13.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
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...
21
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...
1
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...
4
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...
2
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...
49
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...
7
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
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...
14
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.