Page 1 of 1

How to identify Index fields in TMSTable Compact Edition

Posted: Mon 22 Feb 2010 18:39
by otomazeli
I've test the code:
for i := 0 to TBl.FieldCount-1 do
begin
bIsKey := TBl.GetFieldDesc(TBl.Fields.FieldName).IsKey;
if bIsKey then
Showmessage('is key');
end;

But it seems that is not working in compact edition because I'm receiving false for all fields.

Any suggestions?

=================================================
>Hello,

>1. SDAC doesn't support IndexDefs, but you can use the >TMSTable.OrderFields property to build ORDER BY clause of SQL >statement.

>2. You can learn if the field is primary key using the TFieldDesc.IsKey >property. Also you can use the TMSMetadata component to obtain >metainformation about database objects from the server, including >information about primary key.

>Best regards,
>Devart Team
>www.devart.com



>Request Category: Technical
>Product: SQL Server Data Access Components
>Product Version: 4.80.054
>OS Version: Windows XP
>Platform: x32


>Details:

>Hi I'm testing your components to validate if we are going to to >change to SDAC. But I'm having dificulties related to TMSTable I don't >find the IndexDef as used on TTable and there is no way to get the >primary key index field names. Is there a way to do that?

>Thanks in advance.

Posted: Tue 23 Feb 2010 11:03
by Dimon
You should open a table before getting information about fields.

How to identify Index fields in TMSTable Compact Edition

Posted: Thu 25 Feb 2010 18:07
by otomazeli
Hello Dimitry,

I'm not comfortable with your answer!
Of course if I'm trying to access the field properties the table is already open and still doesn't work for compact edition.

Do you have and example showing it should be done? I'm using SDAC Professional Licensed.


Thanks in advance!

Posted: Fri 26 Feb 2010 08:41
by Dimon
The code you are using is correct. But you should execute the TBl.Open method before using it. If you go this way then I can not reproduce the problem.
Please send me an example of your database to reproduce the problem.