473,839 Members | 1,380 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 3197
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
8300
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
3932
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
2856
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
2967
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
4040
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
14371
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
3626
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
6002
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
1825
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
9855
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
9697
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
10908
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...
1
7829
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7018
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
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.