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

Discussion in 'C++' started by bert.medley@logicacmg.com, Sep 27, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Thomas J. Gritzan, Sep 28, 2006
    #2
    1. Advertising

  3. Bert Guest

    OK, and thanks for the redirect!


    Thomas J. Gritzan wrote:
    > 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-lite/how-to-post.html#faq-5.9
    >
    > --
    > Thomas
    > http://www.netmeister.org/news/learn2quote.html
     
    Bert, Sep 28, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    547
    Guest
    Feb 2, 2004
  2. Guest
    Replies:
    0
    Views:
    507
    Guest
    Feb 9, 2004
  3. Daniel Vallstrom
    Replies:
    2
    Views:
    1,897
    Kevin Bracey
    Nov 21, 2003
  4. Guest
    Replies:
    2
    Views:
    195
    Guest
    Feb 2, 2004
  5. Wes Gamble
    Replies:
    1
    Views:
    163
    Gerardo Santana Gómez Garrido
    Apr 5, 2006
Loading...

Share This Page