ODBC Applet question


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: ODBC Applet question

  1. #1
    Igor Guest

    ODBC Applet question


    Hi everybody,
    I recently learned that to show all available ODBC sources all you need to
    do is show so called applet.
    RetVal=Shell("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl,,3", 1)

    that is pretty cool, but the problem is in my VB program I would like to
    choose appropriate ODBC name and when user click OK button somehow catch
    that ODBC name in the program. How do I catch that name in my VB project?
    Thanks in advance.
    Igor


  2. #2
    pavel Guest

    Re: ODBC Applet question


    hi,
    add references to both the Microsoft OLE DB Service Component 1.0 Type Library
    and the Microsoft ActiveX Data Objects 2.x Library and then do something
    like

    Private Sub cmdDSN_Click()
    On Error GoTo ERRORHANDLER
    Dim objDataLink As New DataLinks
    Dim strConn As String
    strConn = objDataLink.PromptNew
    txtDSN.Text = strConn

    Exit Sub
    ERRORHANDLER:
    txtDSN.Text = ""
    End Sub

    "Igor" <irodionov@hotmail.com> wrote:
    >
    >Hi everybody,
    >I recently learned that to show all available ODBC sources all you need

    to
    >do is show so called applet.
    >RetVal=Shell("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl,,3",

    1)
    >
    >that is pretty cool, but the problem is in my VB program I would like to
    >choose appropriate ODBC name and when user click OK button somehow catch
    >that ODBC name in the program. How do I catch that name in my VB project?
    >Thanks in advance.
    >Igor
    >



  3. #3
    pavel Guest

    Re: ODBC Applet question


    hi,
    add references to both the Microsoft OLE DB Service Component 1.0 Type Library
    and the Microsoft ActiveX Data Objects 2.x Library and then do something
    like

    Private Sub cmdDSN_Click()
    On Error GoTo ERRORHANDLER
    Dim objDataLink As New DataLinks
    Dim strConn As String
    strConn = objDataLink.PromptNew
    txtDSN.Text = strConn

    Exit Sub
    ERRORHANDLER:
    txtDSN.Text = ""
    End Sub

    "Igor" <irodionov@hotmail.com> wrote:
    >
    >Hi everybody,
    >I recently learned that to show all available ODBC sources all you need

    to
    >do is show so called applet.
    >RetVal=Shell("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl,,3",

    1)
    >
    >that is pretty cool, but the problem is in my VB program I would like to
    >choose appropriate ODBC name and when user click OK button somehow catch
    >that ODBC name in the program. How do I catch that name in my VB project?
    >Thanks in advance.
    >Igor
    >



  4. #4
    Igor Guest

    Re: ODBC Applet question


    Pavel,
    I guess, I somehow misled you, your code actually brings up window with ODBC
    drivers and OLE DB Providers installed on your machine, but I need to bring
    up ODBC Data Source Administrator window when I can chose appropriate User
    DSN or System DSN. With my code posted in the first message you can see them,
    but you cannot choose one and get that value programmatically( or at least
    I don't know how to do so). If you can shed some light on that your help
    would be greatly appreciated.
    Thanks.
    Igor.
    "pavel" <pavel_orlov@ubd.co.nz> wrote:
    >
    >hi,
    >add references to both the Microsoft OLE DB Service Component 1.0 Type Library
    >and the Microsoft ActiveX Data Objects 2.x Library and then do something
    >like
    >
    >Private Sub cmdDSN_Click()
    >On Error GoTo ERRORHANDLER
    > Dim objDataLink As New DataLinks
    > Dim strConn As String
    > strConn = objDataLink.PromptNew
    > txtDSN.Text = strConn
    >
    > Exit Sub
    >ERRORHANDLER:
    > txtDSN.Text = ""
    >End Sub
    >
    >"Igor" <irodionov@hotmail.com> wrote:
    >>
    >>Hi everybody,
    >>I recently learned that to show all available ODBC sources all you need

    >to
    >>do is show so called applet.
    >>RetVal=Shell("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl,,3",

    >1)
    >>
    >>that is pretty cool, but the problem is in my VB program I would like to
    >>choose appropriate ODBC name and when user click OK button somehow catch
    >>that ODBC name in the program. How do I catch that name in my VB project?
    >>Thanks in advance.
    >>Igor
    >>

    >



  5. #5
    Igor Guest

    Re: ODBC Applet question


    Pavel,
    I guess, I somehow misled you, your code actually brings up window with ODBC
    drivers and OLE DB Providers installed on your machine, but I need to bring
    up ODBC Data Source Administrator window when I can chose appropriate User
    DSN or System DSN. With my code posted in the first message you can see them,
    but you cannot choose one and get that value programmatically( or at least
    I don't know how to do so). If you can shed some light on that your help
    would be greatly appreciated.
    Thanks.
    Igor.
    "pavel" <pavel_orlov@ubd.co.nz> wrote:
    >
    >hi,
    >add references to both the Microsoft OLE DB Service Component 1.0 Type Library
    >and the Microsoft ActiveX Data Objects 2.x Library and then do something
    >like
    >
    >Private Sub cmdDSN_Click()
    >On Error GoTo ERRORHANDLER
    > Dim objDataLink As New DataLinks
    > Dim strConn As String
    > strConn = objDataLink.PromptNew
    > txtDSN.Text = strConn
    >
    > Exit Sub
    >ERRORHANDLER:
    > txtDSN.Text = ""
    >End Sub
    >
    >"Igor" <irodionov@hotmail.com> wrote:
    >>
    >>Hi everybody,
    >>I recently learned that to show all available ODBC sources all you need

    >to
    >>do is show so called applet.
    >>RetVal=Shell("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl,,3",

    >1)
    >>
    >>that is pretty cool, but the problem is in my VB program I would like to
    >>choose appropriate ODBC name and when user click OK button somehow catch
    >>that ODBC name in the program. How do I catch that name in my VB project?
    >>Thanks in advance.
    >>Igor
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center