HOWTO: Generate ODBC & OLEDB Connection Strings with Data Links

ID: Q195913


The information in this article applies to:
  • Microsoft Data Access Components versions 2.0, 2.1 SP2


SUMMARY

Microsoft Data Links, provided with the Microsoft Data Access Components 2.0, provide a convenient and standard way to create and validate the connection string syntax used with an ODBC Driver or OLE DB Provider. Even if you do not reference the data link in your application, when you use Data Links to create your connection string, it validates the connection string syntax to be used with your ODBC Driver or OLE DB Provider.


MORE INFORMATION

Data Links are available after installing Visual Basic 6.0, Data Access SDK 2.x, or MDAC 2.x Run-time Components. You can access Data Links from the Visual Basic 6.0 Data Environment, or from the Microsoft Windows shell, as outlined in the following steps:

Steps to Build a Connection String

  1. Install Visual Basic 6.0, the Data Access 2.x SDK, or MDAC 2.0x Run-time Components.


  2. Right-click on the Windows desktop, point to New, and select Microsoft Data Link to create a Microsoft Data Link shortcut on your desktop (New Microsoft Data Link.udl).


  3. Right-click the New Microsoft Data Link and click Properties to open the Data Link Properties dialog box. To create a connection to a datasource, use the CONNECTION tab.

    NOTE: You can optionally use the ADVANCED and ALL tabs to set specific behavior available to either an ODBC or OLE DB data source.


  4. Once you have completed and tested your connection, click OK to save your new data link.


  5. Open your New Microsoft Data Link.udl file with Notepad (or other text editor). From the .udl file, you can copy the connection string and use it in your application that connects to an MDAC technology.



REFERENCES

For additional information, please see the following Web site:

http://www.microsoft.com/data/

Additional query words:

Keywords : kbADO kbDatabase kbODBC kbOLEDB kbSDKDataAc kbGrpMDAC kbDSupport kbMDAC200 kbMDAC210SP2
Version : WINDOWS:2.0,2.1 SP2
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: November 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.