ODBC Connection remotely RRS feed

  • Question

  • Hi all ,in our organization we have 500 emplyers ,i have giveen the support to our employer ,want to know is there any way to make ODBC connection through remotely means dont visit the user desk or take remote desktop connection ,is ther any way to through script or remotely to create ODBC connection.your feedback will be highly appreciated.
    Friday, April 30, 2010 10:51 AM


All replies

  • Hi,

    You can do it by deploying the registry key directly to the users machines.  If you have Active Directory, you can easily do it by using Policies.  Otherwise, you can make a script able to create these keys dinamically.

    Please, let me know if you have further questions.


    Friday, April 30, 2010 6:43 PM
  • I discuss this at length in my earlier books that included ODBC "Hitchhiker's Guide to Visual Basic and SQL Server" (4th-6th Editions) as well as "ADO Examples and Best Practices". The trick is to use a "DSN-less" connection. This means the ConnectionString contains everthing the ODBC driver needs to see when connecting AND that there is no DSN to look up in the registry. Another approach is to use a File-based DSN but this requires writing another file to the user system. See this link for examples.



    William Vaughn
    Mentor, Consultant, Trainer, MVP

    “Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)”

    Please click the Mark as Answer button if a post solves your problem!

    Saturday, May 1, 2010 6:02 PM
  • Thanks

    Can you please share the detail of registry key or share the script..

    Monday, May 3, 2010 4:35 AM
  • Hi,

    The best practice for ODBC connections is exactly what William is discussing above.  You should try to use DSN-less connections the most you can.  This way, you will avoid the problem of deploying DSNs to client machines.  If your application allows you to establish an ODBC connection string instead of a DSN, you should change it.

    Now, if your application has the DSN name hard-coded and you cannot move to a DSN-less connection, what you can do is looking for [HKLM\SOFTWARE\ODBC\ODBC.ini\MyODBCKey], where MyODBCKey is your DSN.  You can create the DSN in your machine and replicate the settings.  Please, be advised that changing the registry directly is very dangerous.

    As my recommendation, you should do what William is discussing above because it is the safest, the easiest and the recommended way to go.


    Sunday, May 9, 2010 6:28 PM