Solved

Valdity check at rutime

Posted on 2000-03-11
2
174 Views
Last Modified: 2010-04-04
Hi,
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 ...

Abdelghani
0
Comment
Question by:Azzoz
2 Comments
 
LVL 15

Accepted Solution

by:
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 EMPLOYEE
  ADD CHECK (SALARY > 7000)

ALTER TABLE accounts
  MODIFY (bal DEFAULT 0)

(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;

Yours,

Alex
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2608068
just complete ;-)
0

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 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