Subject Re: [IBO] Getting validation source from a domain
Author Thomas Steinmaurer
Ed,

> I am using the code below to try to get the validation source for a
> domain--but it doesn't return anything. I try the same SQL in IBExpert
> (which last I knew used IBO) and it returns a value... what am I
> forgetting?
>
> Thanks
> Ed Dressel
>
> lCursor := CreateCursor('SELECT First 1 RDB$VALIDATION_SOURCE
> FROM RDB$FIELDS WHERE RDB$FIELD_NAME = ''%s''',
> [UpperCase(aName)]);
> try
> try
> if not (FTx.TransactionIsActive or FTx.InTransaction) then
> FTx.StartTransaction;
> lCursor.Open;

Use lCursor.First instead of lCursor.Open

> result := lCursor.RecordCount > 0;

When checking if a result set is empty or not, you'd better use the
.IsEmpty method.




--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com