468,513 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

MS Access, ODBC using Visual C++ 6.0, and external functions

I have a problem that I can distill down to the following.

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
compacted.

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;
try
{
// open database connection to data source; prompt for uid, passwd
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;
}

printf("Sleeping....");
Sleep ((DWORD)180000);
printf("done\n");

Any ideas?

Sep 27 '06 #1
2 7606
be*********@logicacmg.com schrieb:
I have a problem that I can distill down to the following.

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.
_Any_ Microsoft newsgroup would be better to ask. Look here:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Thomas
http://www.netmeister.org/news/learn2quote.html
Sep 27 '06 #2
OK, and thanks for the redirect!
Thomas J. Gritzan wrote:
be*********@logicacmg.com schrieb:
I have a problem that I can distill down to the following.

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.

_Any_ Microsoft newsgroup would be better to ask. Look here:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Thomas
http://www.netmeister.org/news/learn2quote.html
Sep 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Peter Frost | last post: by
3 posts views Thread by Bob | last post: by
reply views Thread by | last post: by
1 post views Thread by somersbar | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.