About Data Links

Before you can access data from ADO or OLE DB, you must provide specific connection information (called initialization properties) such as the type of data that you want to access, the server on which the data resides, and the database in which the data is stored.

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

A data link is a string version of this connection information that you can save and reuse in your applications. This string version can be referred to as a connection string. Initialization properties may vary between OLE DB providers.

Data links are saved either with your application data or in a separate file with a .mdl extension.

See Also

About Data Link Syntax

About OLE DB Data Providers

Creating a Data Link

Working with Data Link Properties

Organizing Data Links


About Data Link Syntax

When you create a data link, a connection string is returned to your application. The syntax of the data link must specify the appropriate OLE DB provider and adhere to several formatting rules.

Basic Data Link Format

The basic format of a connection string is based on the ODBC connection string. The string contains a series of keyword/value pairs separated by semi-colons. The equals sign (=) separates each keyword and its value. For example:

keyword1=value; keyword2=value

Any leading or trailing spaces around a keyword or value is ignored. However, spaces within a keyword or value are allowed and recognized.

Note For more information about data link syntax, see the Data Link API in the Microsoft OLE DB SDK.


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.

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 use data links with any Microsoft or third-party OLE DB provider. The following providers are included with OLE DB:

  • 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, a data link can be saved with the application itself or as a separate file with a .mdl 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 .mdl files, use the Create New Data Link wizard to build a connection string and save it to a data link (.mdl) file. Although your application will prompt you to create a .mdl file as needed, you can also create a data link from Windows Explorer.

To create a data link (.mdl) 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. Complete each step in the Create New Data Link wizard.

See Also

Working with Data Link Properties

Organizing Data Links


Create New Data Link Wizard: Step 1--Specify a Data Provider

Create New Data Link Wizard: Step 1—Specify a Data Provider

Complete this step to specify which OLE DB provider to use to connect to your data.

Step Options

Provider Listbox

Select your OLE DB provider. All OLE DB providers detected on your system hard drive are listed.

See Also

Create New Data Link Wizard: Step 2

Create New Data Link Wizard: Step 3

Create New Data Link Wizard: Step 4


Create New Data Link Wizard: Step 2--Specify the Location of Data

Create New Data Link Wizard: Step 2—Specify the Location of Data

Complete this step to specify the location and name of the data to be accessed.

Step Options

What is the location of the data?

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

The Location property value varies depending on your OLE DB provider. For example:

If the OLE DB Provider is… | The Location is…
Microsoft Jet 3.51 OLE DB Provider | N/A
Microsoft OLE DB Provider for ODBC Drivers | N/A
Microsoft OLE DB Provider for SQL Server | A server name.
Microsoft OLE DB Provider for Oracle | A server name.

What is the data source for the data?

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

The Data Source property value varies depending on your OLE DB provider. For example:

If the OLE DB Provider is… | The Data Source is…
Microsoft Jet 3.51 OLE DB Provider | An Access database (.mdb) file name.
Microsoft OLE DB Provider for ODBC Drivers | A Data Source Name (DSN).
Microsoft OLE DB Provider for SQL Server | A database name.
Microsoft OLE DB Provider for Oracle | N/A

See Also

Create New Data Link Wizard: Step 1

Create New Data Link Wizard: Step 3

Create New Data Link Wizard: Step 4


Create New Data Link Wizard: Step 3--Specify Authentication Information

Create New Data Link Wizard: Step 3—Specify Authentication Information

Complete this step to specify whether you want to use standard authentication or integrated security when logging on to your data.

Integrated security uses an authentication service that enables you to log on using your Windows NT user name and password. Integrated security eliminates the need for you to supply a user name and password in a separate step.

Step Options

How should the authenticity of the logon ID be verified?

Select whether you want to supply a logon ID and password or use integrated security for authentication.

User Name and Password

Enter the user name and password to use for authentication when a user logs on to the data source.

Authentication Service

Enter the name of the authentication service that your OLE DB provider supports.

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.

Note The Microsoft OLE DB providers currently do not support authentication services.

See Also

Create New Data Link Wizard: Step 1

Create New Data Link Wizard: Step 2

Create New Data Link Wizard: Step 4


Create New Data Link Wizard: Step 4--Finish

Create New Data Link Wizard: Step 4—Finish

Complete this step to test the data link and to verify that the settings are correct.

Step Options

Test Connection

Click to attempt a connection to the specified data source.

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

Results

Provides details about the success or failure of the connection.

Advanced

Click to set OLE DB provider-specific initialization properties. Your OLE DB provider may require that you set additional properties before the connection is set up properly.

See Also

Create New Data Link Wizard: Step 1

Create New Data Link Wizard: Step 2

Create New Data Link Wizard: Step 3


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 .mdl file. Data link properties may vary depending on your OLE DB provider.

If your application supports data link (.mdl) 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.

To edit data link properties from Windows Explorer

  1. Right-click a .mdl 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

Connection Tab, Data Link Properties Dialog Box

Authentication 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


Connection Tab, Data Link Properties Dialog Box

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

Tab Options

Provider

Select your OLE DB provider. All OLE DB providers detected on your hard disk are listed.

Location

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

The Location property value varies depending on your OLE DB provider. For example:

If the OLE DB Provider is… | The Location is…
Microsoft Jet 3.51 OLE DB Provider | N/A
Microsoft OLE DB Provider for ODBC Drivers | N/A
Microsoft OLE DB Provider for SQL Server | A server name.
Microsoft OLE DB Provider for Oracle | A server name.

Data Source

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

The Data Source property value varies depending on your OLE DB provider. For example:

If the OLE DB Provider is… | The Data Source is…
Microsoft Jet 3.51 OLE DB Provider | An Access database (.mdb) file name.
Microsoft OLE DB Provider for ODBC Drivers | A Data Source Name (DSN).
Microsoft OLE DB Provider for SQL Server | A database name.
Microsoft OLE DB Provider for Oracle | N/A

Connect

Click to attempt a connection to the specified data source.

Results

Indicates whether the connection was successfully created.

If the connection 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


Authentication Tab, Data Link Properties Dialog Box

Use the Authentication tab to specify whether you want to use standard authentication or an authentication service when logging on to your data. An authentication service enables you to log on using your Windows NT user name and password and eliminates the need for you to supply this information in a separate step.

Depending on your OLE DB provider, some tab options may not be available.

Tab Options

Use Standard Authentication

Click to use a supplied user name and password to authenticate a user who logs on to the data source.

User Name

Enter the User ID to use for authentication when a user logs on to the data source.

Password

Enter the password to use for authentication when a user logs on to the data source.

Authentication Security

These options specify how your OLE DB provider saves authentication information and the level of password security you want to use.

Allow Saving of Authentication Information

Persists sensitive authentication information such as a password along with other authentication information.

Allow Temporarily Saving of Authentication Information

Caches sensitive authentication information such as a password in an internal cache.

Mask Passwords Sent to the Provider

Sends the password to the OLE DB provider in a masked form. Masking provides less security than encryption.

Encrypt Passwords Sent to the Provider

Sends the password to the OLE DB provider in an encrypted form. Encryption provides greater security than masking.

Use Integrated Security

Select to use an authentication service to identify the user.

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.

Authentication Service

Enter the name of the authentication service to use.

Note The Microsoft OLE DB providers currently do not support authentication services.

See Also

Working with Data Link Properties


Advanced Tab, Data Link Properties Dialog Box

Use the Advanced tab to view and set optional 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.

Prompt

Specifies whether to prompt the user during initialization. Select from the following options:

  • Prompt—Always prompt the user for initialization information.

  • Complete—Prompt the user only if more information is needed.

  • Complete Required—Prompt the user only if more information is needed. Do not allow the user to enter optional information.

  • No Prompt—Do not prompt the user.

Locale

Specifies the locale ID (LCID)of preference for the consumer. Consumers specify the LCID at initialization. This provides a method for the server to determine the consumer's LCID of choice in cases where it can use this information. This property does not guarantee that all text returned to the consumer will be translated according to the LCID.

Access Permissions

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

  • Read—Read-only.

  • Write—Write-only.

  • ReadWrite—Read and write.

  • 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

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

Asynchronous Processing

Specifies the asynchronous processing performed on the rowset.

See Also

Working with Data Link Properties


All Tab, Data Link Properties Dialog Box

Use the All tab to view 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

To edit property settings, double-click the property that you want to modify, then enter a valid value in the Edit Property Value dialog box.

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

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 properties that are available for your OLE DB provider. 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

Enter a valid value.

Set value to provider default setting

Check to set this property value to the OLE DB provider default value.

Property required to connect

Check to make this property required to connect to a data source. If this property is not set to a valid value, a connection cannot be established with a data source.

Always use this value

Check to always use this property value in the connection string regardless of any other value that may have been set previously.

See Also

Working with Data Link Properties

All Tab, Data Link Properties 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 .mdl files, you only need to update connection information in the .mdl file. Any application that references the .mdl file instantly accesses the correct data source.

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

  • Creating a data link (.mdl) file

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

  • Organizing data link (.mdl) files

  • Deleting data link (.mdl) files

To organize data link (.mdl) files

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

  2. In the Organize Data Links dialog box, click New, Properties, Rename, or Delete.

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


Select/Organize Data Link Dialog Box

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

Use the Organize Data Link dialog box to add, move, edit, or delete an existing data link (.mdl) file.

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.

File name

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.

Open as Read-Only

Specifies that you will be able to read the file but cannot make changes to it.

New

Click to create a data link file. Follow the steps in the Create New Data Link wizard.

Rename

Click to rename the selected data link file.

Properties

Click to edit the selected data link file.

Delete

Click to delete the selected data link file.

See Also

Organizing Data Links


(Untitled)

Topic Not Found

No matching topic was found. Some possible reasons and remedies are as follows:

  • The file (.chm) that contains the destination topic is not in the expected location.

    Remedy: Rerun the MSDN Library Setup.

  • The file (.chm) that contains the current topic or destination topic is out-of-date and the link is no longer valid.

    Remedy: Install the latest version of the MSDN Library.

  • The MSDN Library CD is not in the CD-ROM drive.

    Remedy: Insert the MSDN Library CD into the CD-ROM drive.