The most basic way of doing this would be to do a bit of sql in your BeforePost event and see if that field is already used. If you don't know anything about the data underneath the TDataSet then this could be a bit tricky.

Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington


Simon Garton wrote:

Quick question : how do I validate uniqueness in a TDataset ? I have some data aware controls and a TDBNavigator; I can check other validation stuff in the BeforePost event, but is there a sensible way of testing whether the field ‘name’ (which has a unique constraint in the database) already exists ?

Many thanks,

Simon Garton

GIS/IT Consultant

email : [EMAIL PROTECTED]

mob : +64 21 227 4666

lat/long : 36º53'17" S, 174º46'50" E

www : http://www.simongarton.co.nz

http://www.treecapture.co.nz

------------------------------------------------------------------------

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to