MS-Access, ODBC access with Visual C++ 6.0, and external actions on database

[was redirected here] I have a problem that I can distill down to the

1/ A Visual C++ 6.0 program connects to a MS Access database using an
ODBC connection and sleeps for a long time.  The connection takes all
defaults and uses CDatabase::useCursorLib  in the OpenEx command.

2/ The database is well over 400MB large with over 200 tables and is

3/ Another process starts a winzip on that database that takes about 45

to 60 seconds to complete (wzzip -a -ex aaa.zip aaa.mdb).

4/ The Windows Task Manager shows 100s of MBs of available memory being

consumed.  When the zip process finishes, the memory is not freed up.

If I repeat the above and do not run the sample C++ program that opens
the database, the zip process consumes no more than 11MB and frees the
memory up when done.  If I lower the sleep time so the C++ program
exists before the zip process completes, the memory is freed up.

The MS access ODBC driver is version 4.00.6304.00

The code snippet that opens the database and sleeps is:

CDatabase pDatabase;
        // open database connection to data source; prompt for uid,
        char szConnect[255];
        wsprintf(szConnect, "DSN=%s;UID=%s;PWD=%s", "My DB",
                            "", "bck_password");
        if (pDatabase.OpenEx(_T(szConnect), CDatabase::useCursorLib))
        strConnect = pDatabase.GetConnect();

catch (...)
        printf("The Database Server is currently unavailable");
        return -20;

Sleep ((DWORD)180000); 

Any ideas?

9/28/2006 2:28:05 PM
comp.win.programmer.misc 1111 articles. 0 followers. MajorSetback (104) is leader. Post Follow

0 Replies

Similar Articles

[PageSpeed] 31