• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

preventing to enter same data

i have a table(this DBF includes fields aa,ab,ac and ad) and this table is index on aa. i want to prevent to enter same data into aa field. How can i prevent entering same data.
thanks
0
mares40
Asked:
mares40
1 Solution
 
mocartsCommented:
create unique index for field "aa"
with SQL (DDL):
create unique index my_index_name on my_table_name (my_column_names)

with Database desktop you must simply check Unique check box in index definition dialog.

wbr, mo.
0
 
ILECommented:
what u need is the unique index
in database desktop
click on restructure table forth button from the left

push the define key

simply click unique check


:))
0
 
mares40Author Commented:
first i append an empty record and then enter the data.
in this case i am using unique index but i can not prevent entering same data.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
mocartsCommented:
you want to prevent users to eneter same data at input stage or when saving to db?
saving to db can be resolved with unique index.
in input stage you must validate user input in Field's OnValidate event. (possibly with DataSet.Locate(..) method or with some SQL query)

wbr, mo.
0
 
CleanupPingCommented:
mares40:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
snehanshuCommented:
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: mocarts

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0
 
Computer101Commented:
Forced accept

Computer101
E-E Admin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now