Valdity check at rutime

Posted on 2000-03-11
Last Modified: 2010-04-04
i ask about set all value of valdity check of field at rutime such as min ,max and defualt value of field all field i mean createtion at rutime ...

Question by:Azzoz
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
LVL 15

Accepted Solution

simonet earned 50 total points
ID: 2608020
There are 2 ways to do this:

1) Do it on the database server: you can set the constraints in the database-level, which is the most adequate approach if you are creating a client/server application. In order to do this, you can execute an SQL statement that will create the constraint:


ALTER TABLE accounts

(actual syntax depends on the DMBS you're using)

2) You can do it using the fields inspector for the TQuery/TTable you are using:

- Double click the TTable/TQuery component;
- Right-click the the Fields window and select "Add all fields"

Ok, this preparation is necessary in Design-time so you can do all the rest in runtime:

Table1.FieldByName('Balance').DefaultExpression := 0;

Table2.FieldByName('Salary').MinValue := 7000;


LVL 27

Expert Comment

ID: 2608068
just complete ;-)

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
HTML text in the body of an email (delphi code) 12 260
Working with hours 3 89
RESTRequest Parameter 4 85
With Delphi XE10, how to use .Manifest file on WIndows 10 Machines 3 62
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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