Retrieve users connected to Access database
Can anyone help me convert the following code to C++? It's code for retrieving the active users of an Access MDB database file. Unfortunately, I cannot google any C++ examples. What totally confuses me is JET_SCHEMA_USERROSTER constant.
Thanx
Bob
Code:
const
JET_SCHEMA_USERROSTER = '{947bb102-5d43-11d1-bdbf-00c04fb92675}';
var
i: Integer;
Line: String;
with ADOConnection1.OpenSchema(adSchemaProviderSpecific, EmptyParam, JET_SCHEMA_USERROSTER) do
while not EOF do
begin
Line := '';
with Fields do
for i := 0 to Count - 1 do
begin
Line := Line + Item[i].Name + ':';
if VarIsNull(Item[i].Value) then
Line := Line + '(Null)'
else
Line := Line + String(Item[i].Value);
Line := Line + #13;
end;
// remove zero bytes
for i := 1 to Length(Line) do
if Line[i] = #0 then
Line[i] := ' ';
ShowMessage(Line);
MoveNext;
end;