IBM Support

Configuring an OLE DB Provider on an SQL Server



This document shows the basic steps to configure a linked server using the IBM i OLE DB data providers on an SQL server.

Resolving The Problem

This document shows the basic steps to configure a linked server using the IBM OLE DB data providers on an SQL server.

To configure a linked server using the IBM OLE DB data providers on an SQL server, you should do the following:

1,Open the SQL Server Enterprise Manager(SQL Server 2000) or SQL Server Management Studio(SQL Server 2005).
2,Under the Console Root, expand Microsoft SQL Servers > SQL Server Group > Local > Security > Linked Servers for SQL Server 2000.
For SQL Server 2005 expand Server Objects > Linked Servers.
3,Right-click on Linked Servers and select New Linked Server.

Select New Linked Server from the pop-up menu.
4.Give your new Linked Server a title in the Linked server: text box.
5.For the Server type, select Other data source and select the desired IBM OLE DB data provider.

To decide which one of our providers would be best to use, you can refer to the following table from the IBM iSeries Access Programmer's Toolkit:

Database ProviderFrameworkConsideration
IBMDA400OLE DB ProviderExisting applications, applications that want the most flexible OLE DB support, including support for SQL, RLA, Data Queues, and Commands.

Note: IBMDA400 does not support SQL commitment control or MTS; it supports only SELECT statements.
IBMDASQLOLE DB ProviderSQL-only support, SQL commitment control, and MTS.
IBMDARLAOLE DB ProviderRLA-only support, forward-only cursors and block fetches with RLA.

Note: IBMDA400 does not support forward-only cursors or block fetches with RLA.
IBM.Data.DB2.iSeries.NET ProviderOffers the best performance when using the .NET framework.
MSDASQLOLE DB ProviderMicrosoft's OLEDB-ODBC bridge, which uses our ODBC driver
Note: Microsoft SQL Server is SQL based. The IBMDASQL OLE DB provider is the provider that should be used with Microsoft SQL Server linked servers.
In the following example, I am using the IBMDASQL provider:

Select one of the IBM OLEDB Providers from the Provider list.

6.Type your Data source. This is the name of your IBM System i server.
Provider string. The Provider string can contain any valid connection properties the provider supports. Connection properties are separated by a semi-colon.
Valid connection properties for the IBM i OLE DB provider can be found in the Programmer's Toolkit and in technote iSeries Access for Windows Custom Connection Properties for OLE DB.
In the example below the 'Default Collection' property is used. This is the default library that you connect to. If nothing is specified, the library of the user profile being used to connect will be used. If you wanted to browse the objects in QIWS, MYLIB, and YOURLIB, you could set the provider string to:
Default Collection=QIWS;Library List=MYLIB,YOURLIB;
Catalog. In Microsoft's terminology, Catalog is the relational database name. Typically you won't need to specify any value in this field. If you are accessing the libraries in an iASP you will need to insert the iASP RDB name in this field; otherwise, the *SYSBASE database name will be retrieved.

Optional:  Add a Provider string of Default Collection=XXXX where XXXX is the default library you want to use.

Note: For SQL Server 2005, the Product Name must have a value. It seems that almost any value works, aside from special characters. In the above example, 'DB2 for i' is used.
8.Click on the Security tab.
9.Select the Be made using this security context radio button.

Select 'Be made using this security context' and type your login credentials.
10.Click OK. You should now see the linked server in the list.
11.The OLE DB provider must be configured to allow inprocess; this only has to be done once per provider but if it is not done, you will get an error 7399 from SQL Server when you attempt to use the linked server. Under server Objects -> Linked Servers -> Providers right click on the provider being used (IBMDASQL, IBMDA400, or IBMDARLA) and select properties.

 Under server Objects -> Linked Servers -> Providers right click on the provider being used (IBMDASQL, IBMDA400, or IBMDARLA) and select properties.

Make sure "Allow Inprocess" is checked.

Check the option to enable 'Allow inprocess'
12.In SQL Server 2000, test the connection by expanding the linked server and double-clicking on Tables. You should see the list of tables in the right pane.

For SQL Server 2000, click on Tables, under your new Linked Server, and you will see a list of the tables in your default library.

Note: For SQL Server 2005, this test may not show a list of tables. This function seems dependent on what version of SQL Server 2005 is being used. For instance this doesn't work
with Express versions but seems to work with Developer or Enterprise editions.

In SQL Server 2005, you can test your linked server by running a simple query:
1.Click on New Query.
2.Type the syntax of the query.
3.Click Execute.

For SQL Server 2005, execute a select using OpenQuery to verify that your new Linked Server is functional.
Note: Some additional configuration steps are often needed to get this working with SQL Server 2005, particularly if this is the first OLEDB provider the SQL Server user has ever tried configuring.

If the user is getting "Msg 7399, Level 16, State 1, Line 1" type errors when attempting to run the sample select statement, this is a problem with the SQL Server service and the rights the user it is running under has. There are two things that can affect this. Note that this is all Microsoft code-related and is as-is at best. Assistance with this should be directed to Microsoft service and support.

o The SQL Server process is likely set to run under something other than the "Local System" account. You can check this in the SQL Server Configuration Manager tool (in the "Configuration Tools" folder in the start menu). This service may be set to run under the built in "Network Service" account or some other account. Change it to the "Local System" account and let Windows restart the service.

o In the SQL Server 2005 Surface Area Configuration tool (also in the "Configuration Tools" folder), select "Surface Area Configuration for Features". On the new panel, select OLE Automation and make sure the "Enable OLE Automation" option is checked. This change should no longer be needed from V6R1 System i Access and beyond; however, up through V5R4 iSeries Access, there are still some OLE automation objects involved.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number


Document Information

Modified date:
18 December 2019