Re: Slow data entry form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Lorien2733 wrote:
My code may
not be elegant but it works. The problem is that the history file is now over
70000 records and it takes a full five seconds to do the validation for each
record. This lag time is a real pain for my users.

Any ideas for speeding this thing up?

Here's an alternative approach:

1) Create database constraints (PRIMARY KEY, UNIQUE, validation
rule/CHECK, etc) with meaningful names to prevent invalid data from
entering the database. You should of course have such constraints in
place anyhow (see
http://www.dbazine.com/ofinterest/oi-articles/celko25).

2) Attempt to enter data into the database (possibly using a
transaction to be able to rollback partial operations etc).

3) Handle any error, using the meaningful constraint name contained in
the error description to determine the nature of the failure.

The idea is that a database round trip would be faster than your
existing five second front end validation code.

For example, rather than querying the database to determine whether the
forthcoming INSERT *would* fall foul of the PRIMARY KEY, instead try
the INSERT to see if it *does* fall foul of the PRIMARY KEY.

Jamie.

--

.



Relevant Pages

  • Re: Validation of text
    ... If you are saying that designing effective database constraints is hard ... Consider that if you have no database level constraints then your data ... should) write form-level validation *and* database level ...
    (microsoft.public.access.forms)
  • Naming conventions for special database objects
    ... I am currently doing a review of my personal database naming ... InsteadOfInsert_Orders for multi-purposed triggers. ... Default constraints ... How to name a primary key if not primary key? ...
    (comp.databases)
  • Re: Validation of text
    ... If you are saying that designing effective database constraints is hard ... should) write form-level validation *and* database level ... you used the Validation Rule property of the fields in your table, ...
    (microsoft.public.access.forms)
  • Re: Best Data storage practice?
    ... We don't care about that stuff; this is the database, ... A column is not a field; it can have constraints. ... PRIMARY KEY, ... Sample data is also a good idea, ...
    (microsoft.public.sqlserver.programming)
  • Re: How do you put a validation rule for ID numbers in Access?
    ... There are two places to implement the business rule: a) the database ... constraints nor the ANSI CREATE ASSERTION syntax for validation at the ... " If the code is a foreign key in several tables, the validation needs ... The OP should take a look at UNIQUE CONSTRAINT (keywords in uppercase, ...
    (microsoft.public.access.tablesdbdesign)