CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2001
    Location
    Germany
    Posts
    20

    Question ADO threads in win98

    Hi,

    im using ADO to read an Access 2000 database. Now i tried to do the reading in a separate thread using AfxBeginThread. This works fine with Windows 2000, but crashes with Windows 98, when I try to create the connection object:

    TESTHR(hr = m_pConn.CreateInstance(__uuidof(ADODB::Connection)));

    Any ideas?

    Thanks,

    Winni.

  2. #2
    Join Date
    May 2002
    Location
    Russia
    Posts
    1,571
    Try this

    hr = m_pConn.CreateInstance(__uuidof(ADODB::Connection));
    if (FAILED(hr))
    //show somithing terrible message box

  3. #3
    Join Date
    Feb 2001
    Location
    Germany
    Posts
    20

    Solution

    Hi,

    the problem was, that i had to call CoInitialize/CoUninitialize in the thread routine. After inserting this it works. Strange, that win 2000 doesn´t mind.

    Thanks,

    winni

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured