Forcing Display of "Select Data Source" Dialogue RRS feed

  • Question

  • Hi

    I'm not entirely sure where to place this post, but ill go ahead here and move it as needed.


    I'm about to start work on a small scale project which will use odbc to connect to a database, Upon the launch of the application i would like the following to happen

    1 - Program checks for a saved setting containing a data source name, if no name exists then the "Select Data source" screen will be displayed to the user. (this is the screen that is typically shown when telling an application to use either an ODBC or DSN connection)

    2 -  A database is selected and a Login form is opened

    3 - The value from the above selection is both displayed in a read only field/label upon the login form,at the point the user enters there username and passowrd, an odbc connection is established and the specific Data source name is saved into registry for future use, to speed startup next time.


    I have a reasonable understanding of how to do most of the above, except for how i can get the "Select Data source" screen to be displayed to the user, So any help would be appreciated.


    Cheers - Adam


    p.s. This a a link to a screenshot of the 'Select data source' screen i am on about - http://www.plus2net.com/sql_tutorial/images/select_data_source.jpg

    • Edited by SimAda00 Thursday, July 15, 2010 11:16 AM
    Monday, July 12, 2010 8:48 PM

All replies

  • Hi Adam,

    Did you try to check the saved setting, if no name exists, then show the "Select Data Source" form to the user ? For example:

    If Not IsNameExist() Then




    End If

    Best regards,
    Alex Liang

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, July 15, 2010 3:48 AM
  • Cheers, its not quite what im after though. There is a specific screen in windows that provides this function and im trying to work out if there is an API method or a call i can make within visual studio. I'm trying to get this popup to appear - http://www.plus2net.com/sql_tutorial/images/select_data_source.jpg.


    The same one that appears if you use visual studio when you go to add a newconnection and select the build a connection string option.

    Thursday, July 15, 2010 11:26 AM
  • hey SimAda00

    were you able to do this ???

    my problem is it should not show the select datasource window to the user 

    some how related to your's ..

    if you were able to achieve this then please let me know .. would be of great help


    Tuesday, December 28, 2010 6:48 PM
  • I stumbled accross this the other week which i haven't tried yet, but plan to. Seems to do what we want to do.





    Sunday, March 13, 2011 12:19 PM