Hello Experts,
I want the List of First Primary Key from Table Ids, I Have All Table Ids, But do not able to find First Primary Key of those table,
I used object table to find table ids. If Any one have idea, give me hint, may be that small hint focus on my problem. Thanks in Advance.
Thanks & Regards.
Purvesh Maisuria.
0
Answers
You have there Table No.
Thank U Very Much, I Have No Words, How Can I Say Thanks To U People.
Just Want To Say That U People Are "The Great". =D>
I Solve My Problem From Your Suggested Link. Hope U People Help & Support When We Are In Problem In Future.
Thanks & Regards,
Purvesh Maisuria.
Luc's method is the easiest one
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
May Be U R Right, But I Didn't use That, I Write Some Code To Get First Primary Key Of Table.
===================Variables=================
Obj1 Record Object
PK KeyRef
RecRef RecordRef
i Integer
Field FieldRef
KeyString Text 1024
First Integer
===================Code====================
Obj1.RESET;
Obj1.SETRANGE(Type,1);
Obj1.SETRANGE(Obj1.ID,TableId);
IF Obj1.FIND('-') THEN
REPEAT
RecRef.OPEN(Obj1.ID);
PK:=RecRef.KEYINDEX(1);
FOR i := 1 TO PK.FIELDCOUNT DO BEGIN
Field := PK.FIELDINDEX(i);
IF First=1 THEN
BEGIN
KeyString:=Field.NAME;
First:=First+1;
END
ELSE
KeyString:=KeyString + ',' +Field.NAME;
END;
TableName1:=Obj1.Name;
TableKey:=KeyString;
RecRef.CLOSE();
KeyString:='';
UNTIL Obj1.NEXT=0;
===================Code====================
Thanks & Regards,
Purvesh Maisuria.