About ADOTable Get PrimaryKey |
|
ckc8088
一般會員 ![]() ![]() 發表:3 回覆:7 積分:2 註冊:2002-07-11 發送簡訊給我 |
|
阿子
站務副站長 ![]() ![]() ![]() ![]() 發表:120 回覆:230 積分:201 註冊:2002-03-18 發送簡訊給我 |
|
ckc8088
一般會員 ![]() ![]() 發表:3 回覆:7 積分:2 註冊:2002-07-11 發送簡訊給我 |
|
ckc8088
一般會員 ![]() ![]() 發表:3 回覆:7 積分:2 註冊:2002-07-11 發送簡訊給我 |
各位同胞 解出來了 如下 procedure TAlphaDB.GetPrimaryKeys(var sItems: TStringList);
var
I,iIndex: Integer;
IndexDefs: TIndexDefs;
IndexDef: TIndexDef;
begin
// OpenDataSet(ADOSource);
sItems.Clear;
if ADOSource is TADOTable then
IndexDefs := TADOTable(ADOSource).IndexDefs
else
Exit;
IndexDefs.Update;
for I := 0 to IndexDefs.Count - 1 do
if IndexDefs[I].Name = '' then
sItems.Add('') else
sItems.Add(IndexDefs[I].Name);
If sItems.Count=0 Then
Exit;
if sItems.Count > 0 then
begin
if sItems.IndexOf(ADOSource.IndexName) > 0 then
iIndex:= sItems.IndexOf(ADOSource.IndexName)
else
iIndex:=0;
end;
if ADOSource is TADOTable then
IndexDef := TADOTable(ADOSource).IndexDefs[iIndex]
Else
Exit;
DispItems(IndexDef.Fields,';',sItems);
end;
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |