Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Valdity check at rutime

Posted on 2000-03-11
2
Medium Priority
?
183 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
[X]
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
2 Comments
 
LVL 15

Accepted Solution

by:
simonet earned 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

670 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