DBEngine Object Example (VC++)

This example enumerates the collections of the DBEngine object. See the methods and properties of DBEngine for additional examples.

CdbDBEngine         dbeng;
CdbDatabase         dbsLudlow;
CdbWorkspace      wrkEnum;
long            intWSP;

// Enumerate all workspaces.

printf(_T("Workspaces: Name, UserName\n"));
for (intWSP = 0; dbeng.Workspaces.GetCount(); intWSP++)
{
   wrkEnum = dbeng.Workspaces[intWSP];
   printf(_T("  %s, %s"), wrkEnum.GetName(), wrkEnum.GetUserName());
}

// display built-in properties.
printf(_T("\nDBEngine.Version: %s\n"), dbeng.GetVersion());
printf(_T("DBEngine.LoginTimeout: %s\n"), dbeng.GetLoginTimeout());