如何得到被参照的表?急死我了!

eagleyin 2000-07-16 05:08:00
各位大虾:
有谁知道怎样从DELPHI数据库控件中获得某个表与其他表之间的参照关系???
我尝试从DATASET中找,但太复杂,找了半天没有结果,有谁知道的请一定不吝赐教,
谢谢谢谢.
...全文
115 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
eagleyin 2000-07-16
  • 打赏
  • 举报
回复
太谢谢BLUECAT了,不过如果我用ADO而不用BDE的话,有办法么?
BLUECAT 2000-07-16
  • 打赏
  • 举报
回复
具体请参阅BDE的帮助
The function is:
fDbiGetRIntDesc(OrdersTbl, 1, MyList);

function fDbiGetRIntDesc(Table: TTable; SeqNo: Word; RIntList: TStringList): RINTDesc;

var
ThisTable, OtherTable: string;
Props: CURProps;
B: Byte;
begin
ThisTable := '';
OtherTable := '';
FillChar(Result, sizeof(Result), #0);
Check(DbiGetCursorProps(Table.Handle, Props));
if (Props.iRefIntChecks = 0) then
raise EDatabaseError.Create('There are no referential integrity checks on this table');
Check(DbiGetRIntDesc(Table.Handle, SeqNo, @Result));
if (RIntList <> nil) then begin

with RIntList do begin
Add(Format('NUMBER=%d', [Result.iRintNum]));
Add(Format('NAME=%s', [Result.szRintName]));
case Result.eType of
rintMASTER: Add('TYPE=MASTER');
rintDEPENDENT: Add('TYPE=DEPENDENT');
else
Add('TYPE=UNKNOWN');
end;
Add(Format('OTHER TABLE=%s', [Result.szTblName]));
case Result.eModOp of
rintRESTRICT: Add('MODIFY=RESTRICT');

rintCASCADE: Add('MODIFY=CASCADE');
else
Add('MODIFY=UNKNOWN');
end;
case Result.eDelOp of
rintRESTRICT: Add('DELETE=RESTRICT');
rintCASCADE: Add('DELETE=CASCADE');
else
Add('DELETE=UNKNOWN');
end;
Add(Format('FIELD COUNT=%d', [Result.iFldCount]));
for B := 0 to DBIMAXFLDSINKEY do begin
if (Result.aiThisTabFld[B] <> 0) then begin

if (B <> 0) then
ThisTable := Format('%s, %d', [ThisTable, Result.aiThisTabFld[B]])
else
ThisTable := IntToStr(Result.aiThisTabFld[B]);
end
else
Break;
end;
Add('FIELDS=' + ThisTable);
for B := 0 to DBIMAXFLDSINKEY do begin
if (Result.aiOthTabFld[B] <> 0) then begin
if (B <> 0) then

OtherTable := Format('%s, %d', [OtherTable, Result.aiOthTabFld[B]])
else
OtherTable := IntToStr(Result.aiOthTabFld[B]);
end
else
Break;
end;
Add('FIELDS OTHER=' + OtherTable);
end;
end;
end;
BLUECAT 2000-07-16
  • 打赏
  • 举报
回复
如果你用的是SQL-SERVER的话,可以从系统表中得出
蝈蝈俊 2000-07-16
  • 打赏
  • 举报
回复
?????
码狂 2000-07-16
  • 打赏
  • 举报
回复
听不明白你的意思?

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧