Author: Jonas Bilinkevicius
Is it possible to get a list of all current users from the BDE? If I try to
overwrite a file the BDE will tell me who is using it, one at a time. It would be
quicker if I could get a complete list.
Answer:
With Paradox, yes:
1 procedure BDEGetPDXUserList(AList: TStrings);
2 var3 hCur: hDBICur;
4 UDesc: USERDesc;
5 begin6 AList.Clear;
7 Check(DBIOpenUserList(hCur));
8 try9 while DBIGetNextRecord(hCur, dbiNOLOCK, @UDesc, nil) <> DBIERR_EOF do10 begin11 AList.Add(StrPas(UDesc.szUserName));
12 end;
13 finally14 DBICloseCursor(hCur);
15 end;
16 end;