CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2002
    Location
    France, Toulouse
    Posts
    156

    ODBC Driver Configuration Dialog

    Hi

    I am calling :
    CDatabase::OpenEx to configure an ODBC connection, from a MFC based Dialog, and when I choose a MySql driver (3.51.15) the connection configuration Dialog goes behind my dialog?
    when I select Access or any other driver all is OK, and my dialog is behind the driver dialog.

    I tried SQLConfigDataSource with the HWND of my Dialog and I have the same behaviour.

    Environment: vs 2005, MFC, winXP.

    Thank you

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ODBC Driver Configuration Dialog

    Add CDatabase::noOdbcDialog option to the dwOptions parameter in OpenEx call.
    Victor Nijegorodov

  3. #3
    Join Date
    May 2002
    Location
    France, Toulouse
    Posts
    156

    Re: ODBC Driver Configuration Dialog

    thank you for your reply

    but I want to display the dialog to configure the datasource, but I want the dialog to be on the front of my application Dialog?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ODBC Driver Configuration Dialog

    Sorry for my inattention!
    Victor Nijegorodov

  5. #5
    Join Date
    May 2007
    Posts
    437

    Re: ODBC Driver Configuration Dialog

    Add CDatabase::forceOdbcDialog option to the dwOptions parameter in OpenEx call.
    ashu
    always use code tag

  6. #6
    Join Date
    May 2002
    Location
    France, Toulouse
    Posts
    156

    Re: ODBC Driver Configuration Dialog

    May be I was not very clear in my first post.

    my call is the following:

    CDatabase db;
    db.OpenEx(sConnectionString,CDatabase:penReadOnly | CDatabase::forceOdbcDialog);

    The ODBC Driver Dialog is Displayed, but its behind the calling dialog (mine), and this just when the driver is Mysql. for other drivers all is OK.

    So I tried :

    SQLConfigDataSource(pDlg->GetSafeHwnd(),ODBC_ADD_DSN,sDriver,"");
    And I have the same behaviour, the MySql ODBC Driver is behind my main window.

    thank you.

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