About Data Links

Before you can access data from OLE DB, you must provide specific connection information such as:

•	The type of data that you want to access.

•	The server on which the data resides.

•	The database in which the data is stored.

For example, to connect to a Microsoft® SQL Server™ database you need to specify the OLE DB provider for SQL Server, a server name, and a database name.

A connection string is a string version of this connection information that you can save and reuse in your applications. The user interface that prompts you to build the connection string is referred to as the data link dialog boxes. The information specified in a connection string may vary depending on the OLE DB provider that is specified. In addition, the data link dialog box options may vary depending on the OLE DB provider that is specified.

Once created, a connection string can be saved either with your application data or in a separate file with a .udl extension. This file is referred to as a Microsoft Data Link (.udl) file. Whether you save a connection string with your application data or you save a connection string as a data link (.udl) file depends on the functionality of your application.

See Also

About OLE DB Data Providers

Creating a Data Link

Working with Data Link Properties

Organizing Data Links


About OLE DB Data Providers

An OLE DB data provider allows native access to data, such as a SQL Server or Oracle database. Using an OLE DB provider, your application can retrieve and manipulate data from a wide variety of data sources, not just relational databases. When you create a data link, you specify the OLE DB provider that is designed to work with your data.

For example, you could access an email or flat file system using the appropriate OLE DB provider and display the data in a client application. In OLE DB terms, when you access data from your application, your application is often defined as a data consumer.

You can create data links for any Microsoft or third-party OLE DB provider. The following providers are included with the Microsoft data access components:

•	Microsoft Jet 3.51 OLE DB Provider

•	OLE DB Provider for Oracle

•	OLE DB Provider for SQL Server

•	OLE DB Provider for ODBC Drivers

Note   For more information about OLE DB providers, see the OLE DB Programmer's Reference. This documentation is available in the Microsoft Data Access SDK.


Creating a Data Link

Depending on your application, you can save a data link with the application itself or as a separate file with a .udl extension.

If your application saves and manages your data links, then your application will prompt you for a connection string as needed through the Data Link Properties dialog box.

If your application supports .udl files, you first create the data link (.udl) file, then build the connection string in the Data Link Properties dialog box. The connection string is stored in the data link (.udl) file. Although your application will prompt you to create a .udl file as needed, you can also create a data link from Windows Explorer.

Note   If your application does not support .udl files, you can still create and edit .udl files from Control Panel or your desktop for use in other applications or as a way to manage connection information to other data.

To create a data link (.udl) file from Windows Explorer

1	Right-click within an Explorer window or from your desktop and select Microsoft Data Link from the New menu.

2	Right-click the file and select Properties from the menu.

3	Set the data link properties in the Data Link Properties dialog box.

If you like, you can rename the file by right-clicking it and selecting Rename from the menu.

See Also

Working with Data Link Properties

Organizing Data Links


Working with Data Link Properties

Use the Data Link Properties dialog box to specify initialization properties for your OLE DB provider. These properties are saved as a connection string either with your application data or in a .udl file. Data link properties may vary depending on your OLE DB provider.

Setting Connection Properties for Your OLE DB Provider

Depending on the OLE DB provider that you use, the connection properties for a data link can vary. Connection properties allow you to specify where your data is located and how to connect to the data.

The Connection tab of the Data Link Properties dialog box is provider-specific and displays only the connection properties that are required by the selected OLE DB provider.

If you use a provider other than those that are included with the data access components, then a generic dialog box is available to set connection properties.

Viewing the Initialization Properties Available for Your OLE DB Provider

To view all initialization properties supported by your OLE DB provider, navigate to the All tab of the Data Link Properties dialog box. This tab is useful if you need to set a provider-specific initialization property.

Accessing and Editing Connection Strings

If your application supports data link (.udl) files, you can access the Data Link Properties dialog box at any time from your application or your desktop. If not, then this dialog box is accessible only from your application.

Note   If your application does not support .udl files, you can still create and edit .udl files from Control Panel or your desktop for use in other applications or as a way to manage connection information to other data.

To edit data link properties from Windows Explorer

1	Right-click a .udl file within an Explorer window or from your desktop, then choose Properties from the menu.

2	Modify one or more data link properties in the Data Link Properties dialog box.

See Also

About Data Links

Connection Tab, Data Link Properties Dialog Box

Advanced Tab, Data Link Properties Dialog Box

All Tab, Data Link Properties Dialog Box

Edit Property Value Dialog Box


Organizing Data Links

As you acquire new data sources, upgrade others, and remove those that are obsolete, you can easily maintain the data links that connect to your data. For applications that support .udl files, you only need to update connection information in the .udl file. Any application that references the .udl file instantly accesses the correct data source.

Use the Organize Data Link Files dialog box to complete basic file management tasks such as:

•	Creating a data link (.udl) file

•	Editing the properties of an existing data link (.udl) file

•	Deleting a data link (.udl) file

•	Organizing data link (.udl) files by copy and pasting files to different folders.

To create a data link (.udl) file

1	In Control Panel, double-click the Data Links icon.

2	In the Organize Data Link Files dialog box, right-click anywhere within the file list, then select Microsoft Data Link from the New menu to create a new data link.

To edit a data link (.udl) file

•	In the Organize Data Link Files dialog box, right-click a data link file, then choose Properties to edit the file.

To delete a data link (.udl) file

•	In the Organize Data Link Files dialog box, right-click a data link file, then choose Delete to delete the file.

To move a data link (.udl) file

•	In the Organize Data Link Files dialog box, copy and paste data link files to the folder of your choice.

Note   You can also organize data links in the Select Data Links dialog box.


Provider Tab, Data Link Properties Dialog Box

Use the Provider tab to select the appropriate OLE DB provider for the type of data you want to access. Not all applications allow you to specify a provider or modify the current selection; this tab is displayed only if your application allows the OLE DB provider selection to be edited.

Tab Options

OLE DB Provider List   Lists all OLE DB providers detected on your hard disk.

Next   Navigates to the Connection tab for the selected OLE DB provider.

See Also

Working with Data Link Properties


Connection Tab, Data Link Properties Dialog Box

Use the Connection tab to specify how to connect to your data using an OLE DB Provider other than those that are included with the Microsoft Data Access Components.

Tab Options

1.	Enter the data source and location of the data:

Data Source   Enter the name of the data source that you want to access. Typically, this is a server name.

Location   Enter the location of the data source that you want to access. Typically, this is a database name.

2.	Enter information to log on to the server:

Use Windows NT Integrated Security   Select to use an authentication service to identify yourself.

To use this feature, your OLE DB provider must support an authentication service and you must have permissions in the data source to use the authentication service.

Use a specific user name and password   Click to use a supplied user name and password to authenticate your logon information to the data source.

User Name   Enter the User ID to use for authentication when you log on to the data source.

Password   Enter the password to use for authentication when you log on to the data source.

Blank Password   Enables the specified provider to return a blank password in the connection string.

Allow Saving Password   Allows the password to be saved with the connection string. Whether the password is included in the connection string depends on the functionality of the calling application.

Note   If saved, the password is returned and saved unmasked and unencrypted.

3.	Enter the initial catalog to use:

Enter the database that you want to access.

Test Connection   Click to attempt a connection to the specified data source.

If the connections fails, ensure that the settings are correct. For example, spelling errors and case sensitivity may be the cause of a failed connection.

See Also

Working with Data Link Properties

Connection Tab (SQL Server)

Connection Tab (Jet)

Connection Tab (Oracle)

Connection Tab (ODBC)


Connection Tab (SQL Server), Data Link Properties Dialog Box

Use the Connection tab to specify how to connect to Microsoft SQL Server data.

Tab Options

1.	Select or enter a server name:

Enter the server where the database you want to access is located.

2.	Enter information to log on to the server:

Use Windows NT Integrated Security   Select to use an authentication service to identify yourself.

To use this feature, your OLE DB provider must support an authentication service and you must have permissions in the data source to use the authentication service.

Use a specific user name and password   Click to use a supplied user name and password to authenticate your logon information to the data source.

User Name   Enter the User ID to use for authentication when you log on to the data source.

Password   Enter the password to use for authentication when you log on to the data source.

Blank Password   Enables the specified provider to return a blank password in the connection string.

Allow Saving Password   Allows the password to be saved with the connection string. Whether the password is included in the connection string depends on the functionality of the calling application.

Note   If saved, the password is returned and saved unmasked and unencrypted.

3.	Select the database on the server:

Enter the database that you want to access.

Or, attach an SQL database file as a database name:

Enter the database name to use for the attached SQL database file.

Note   This feature requires SQL Server 7.0.

Using the filename:

Enter the name of the single-file database file. To browse for the file, click the button.

Test Connection   Click to attempt a connection to the specified data source.

If the connections fails, ensure that the settings are correct. For example, spelling errors and case sensitivity may be the cause of a failed connection.

See Also

Working with Data Link Properties


Connection Tab (Jet), Data Link Properties Dialog Box

Use the Connection tab to specify how to connect to Microsoft Access data.

Tab Options

1.	Select or enter a database name:

Enter the Microsoft Access database (.mdb) file name that you want to access. To browse for the file, click the button.

2.	Enter information to log on to the database:

User Name   Enter the User ID to use for authentication when you log on to the data source.

Password   Enter the password to use for authentication when you log on to the data source.

Blank Password   Enables the specified provider to return a blank password in the connection string.

Allow Saving Password   Allows the password to be saved with the connection string. Whether the password is included in the connection string depends on the functionality of the calling application.

Note   If saved, the password is returned and saved unmasked and unencrypted.

Test Connection   Click to attempt a connection to the specified data source.

If the connections fails, ensure that the settings are correct. For example, spelling errors and case sensitivity may be the cause of a failed connection.

See Also

Working with Data Link Properties


Connection Tab (Oracle), Data Link Properties Dialog Box

Use the Connection tab to specify how to connect to Oracle data.

Tab Options

1.	Enter a server name:

Enter the server where the database you want to access is located.

2.	Enter information to log on to the server:

User Name   Enter the User ID to use for authentication when you log on to the data source.

Password   Enter the password to use for authentication when you log on to the data source.

Blank Password   Enables the specified provider to return a blank password in the connection string.

Allow Saving Password   Allows the password to be saved with the connection string. Whether the password is included in the connection string depends on the functionality of the calling application.

Note   If saved, the password is returned and saved unmasked and unencrypted.

Test Connection   Click to attempt a connection to the specified data source.

If the connections fails, ensure that the settings are correct. For example, spelling errors and case sensitivity may be the cause of a failed connection.

See Also

Working with Data Link Properties


Connection Tab (ODBC), Data Link Properties Dialog Box

Use the Connection tab to specify how to connect to ODBC data.

Tab Options

1.	Specify the source of data:

Use data source name   Select or enter the ODBC data source name (DSN) that you want to access.

Use connection string   Allows you to enter or build an ODBC connection string rather than using an existing DSN.

Connection string—Enter an ODBC connection string.

Build—Opens the ODBC Select Data Source dialog box. Once you select a Data Source, the connection string in that data source will be returned and set into the connection string edit control.

If you select a File DSN, then the resulting ODBC connection string is DSN-less. The ODBC connection string is persisted in the data link (.udl) file and does not rely on the selected File DSN.

If you select a Machine DSN, then the resulting ODBC connection string is DSN-based. The ODBC connection string references the selected Machine DSN. If a user on a different system attempts to access the data link (.udl) file, the user must also have the Machine DSN installed.

2.	Enter information to log on to the server:

User Name   Enter the User ID to use for authentication when you log on to the data source.

Password   Enter the password to use for authentication when you log on to the data source.

Blank Password   Enables the specified provider to return a blank password in the connection string.

Allow Saving Password   Allows the password to be saved with the connection string. Whether the password is included in the connection string depends on the functionality of the calling application.

Note   If saved, the password is returned and saved unmasked and unencrypted.

Test Connection   Click to attempt a connection to the specified data source.

If the connections fails, ensure that the settings are correct. For example, spelling errors and case sensitivity may be the cause of a failed connection.

See Also

Working with Data Link Properties


Advanced Tab, Data Link Properties Dialog Box

Use the Advanced tab to view and set other initialization properties for your data.

Note   For more information about advanced initialization properties, see the documentation provided with your OLE DB provider.

Tab Options

Impersonation Level   The level of impersonation that the server is allowed to use when impersonating the client. This property applies only to network connections other than Remote Procedure Call (RPC) connections; these impersonation levels are similar to those provided by RPC. The values of this property correspond directly to the levels of impersonation that can be specified for authenticated RPC connections, but can be applied to connections other than authenticated RPC. Select from the following levels:

•	Anonymous—The client is anonymous to the server. The server process cannot obtain identification information about the client and cannot impersonate the client.

•	Identify—The server can obtain the client's identity. The server can impersonate the client for ACL checking but cannot access system objects as the client.

•	Impersonate—The server process can impersonate the client's security context while acting on behalf of the client. This information is obtained when the connection is established, not on every call.

•	Delegate—The process can impersonate the client's security context while acting on behalf of the client. The server process can also make outgoing calls to other servers while acting on behalf of the client.

Protection Level   The level of protection of data sent between client and server. This property applies only to network connections other than RPC connections; these protection levels are similar to those provided by RPC. The values of this property correspond directly to the levels of protection that can be specified for authenticated RPC connections, but can be applied to connections other than authenticated RPC. Select from the following levels:

•	None—Performs no authentication of data sent to the server.

•	Connect—Authenticates only when the client establishes the connection with the server.

•	Call—Authenticates the source of the data at the beginning of each request from the client to the server.

•	Pkt—Authenticates that all data received is from the client.

•	Pkt Integrity—Authenticates that all data received is from the client and that it has not been changed in transit.

•	Pkt Privacy—Authenticates that all data received is from the client, that it has not been changed in transit, and protects the privacy of the data by encrypting it.

Connect Timeout   Specifies the amount of time (in seconds) that the OLE DB provider waits for initialization to complete. If initialization times out, an error is returned and the connection is not created.

Access Permissions   Specifies the access permissions. Select one or more of the following permissions:

•	Read—Read-only.

•	ReadWrite—Read and write.

•	Share Deny None—Neither read nor write access can be denied to others.

•	Share Deny Read—Prevents others from opening in read mode.

•	Share Deny Write—Prevents others from opening in write mode.

•	Share Exclusive—Prevents others from opening in read/write mode

•	Write—Write-only.

See Also

Working with Data Link Properties


All Tab, Data Link Properties Dialog Box

Use the All tab to view and edit all of the OLE DB initialization properties that are available for your OLE DB provider. Properties may vary, depending on the OLE DB provider that you are using.

Tab Options

Initialization Properties List   Lists all properties and their currently set values.

Note   For more information about the initialization properties in the list, see the documentation provided with your OLE DB provider.

Edit Value   Opens the Edit Property Value dialog box for the currently selected property.

Tip   Double-click the property that you want to modify to open the Edit Property Value dialog box.

See Also

Working with Data Link Properties


Edit Property Value Dialog Box

Use the Edit Property Value dialog box to edit the OLE DB initialization property that is currently selected in the All Tab . Properties may vary, depending on the OLE DB provider that you are using.

Note   For more information about provider-specific properties, see the documentation provided with your OLE DB provider.

Dialog Box Options

Property Description   Displays the description of the selected property.

Property Value   Select or enter a valid value.

Reset Value   Sets the selected property value to the OLE DB provider default value.

See Also

Working with Data Link Properties

All Tab, Data Link Properties Dialog Box


Select/Organize Data Link Dialog Box
Select/Organize Data Link Files Dialog Box

Use the Select Data Link dialog box to select an existing data link (.udl) file or to create a new one.

Use the Organize Data Link Files dialog box to edit, delete, or move an existing data link (.udl) file or to create a new one.

Dialog Box Options

Look in   Enables you to navigate among all of the drives and folders on your system.

Up One Level   Click to navigate to a folder that you have previously accessed during the current session.

Create New Folder   Click to create a folder within the current folder.

File List   Displays the files and folders in the drive or folder selected in the Look in box.

List   Click to view the file list names in large icon format.

Details   Click to view additional information about the documents in the file list such as the file size and the date last saved.

File name   Enter the name of the file you want to open, or enter a drive letter such as C:\ to navigate to a drive.

Files of type   Lists the types of files to display. This is useful for narrowing the list of files displayed to only those files you're interested in.

Open   Click to open the selected file. This option applies only to the Select Data Link dialog box.

Close   Click to close the dialog box. This option applies only to the Organize Data Link Files dialog box.

See Also

Organizing Data Links