用BDE取索引列表的问题 -wrench(200分)

W

wrench

Unregistered / Unconfirmed
GUEST, unregistred user!
近日写程序 碰到如下代码
try
Check(DbiOpenIndexList(ADatabase.Handle, PChar(ATableName), nil, hIdxList));
except
DbiCloseCursor(hIdxList);
Exit;
end;

while DbiGetNextRecord(hIdxList, DbiNoLock, @IndexDesc, nil) <> DbiErr_Eofdo
with IndexDescdo
if FindFieldInIndex then
// 如果在索引中找到当前字段
begin
if bPrimary then
IsPrimaryKey := True;
// 主关键字
if iFldsInKey = 1 then
// 索引中只包含当前字段, 因此认为当前字段是唯一
IsUnique := True;
end;
DbiCloseCursor(hIdxList);
用以查找主关键字
这段程序 对SQL Server里面确总是不能取到索引列表
我跟了一天,没有找到问题所在。
后来无奈之下,重新取看帮助发现这么一段
For SQL databases, this parameter can be a fully qualified name that includes the owner name.
原来一定要加owner的表名才可以用 如dbo.tablename
贴出来 算给大家提个醒

又 谁知道niceme 1.6的注册号? 100分
本来想多给的 但是曾经有人批评我非技术问题给分太多
所以 就给100算了
剩下的分给又价值的帖子
 
W

wjiachun

Unregistered / Unconfirmed
GUEST, unregistred user!
niceme 是干嘛的啊?
 
W

wrench

Unregistered / Unconfirmed
GUEST, unregistred user!
搞错了
是nicemc ,winamp的插件,用来播放mpeg和avi的
 
W

wjiachun

Unregistered / Unconfirmed
GUEST, unregistred user!
NiceMC Media Plugin
Version: 1.61
Name: Free User s/n: 104784712
Nicemc Media Plugin For Winamp
Version: 1.7
URL: www.nicemcmedia.com
Name: thE WiShMakEr s/n: 127895738
 

温柔一刀

Unregistered / Unconfirmed
GUEST, unregistred user!
to wrench:
这个问题李颖曾经提起过,因为他做那个dbbackup,也碰到这问题,后来如此才解决的。
 
W

wrench

Unregistered / Unconfirmed
GUEST, unregistred user!
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
706
import
I
顶部