How to get a list of all current users from the BDE (Views: 28)
Problem/Question/Abstract: 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: procedure BDEGetPDXUserList(AList: TStrings); var hCur: hDBICur; UDesc: USERDesc; begin AList.Clear; Check(DBIOpenUserList(hCur)); try while DBIGetNextRecord(hCur, dbiNOLOCK, @UDesc, nil) <> DBIERR_EOF do begin AList.Add(StrPas(UDesc.szUserName)); end; finally DBICloseCursor(hCur); end; end; |