Solved

Valdity check at rutime

Posted on 2000-03-11
2
165 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now