Provider

Description

Identifies the data provider you want to use to connect to your data source.

When to specify Provider

You must specify the Provider parameter before connecting to the database.

Where to specify Provider

You can select the provider on the Connection tab of the Database Profile Setup dialog box; and the Provider parameter and its value will be shown in the connection string on the Preview tab.

Applies to

ADO.NET

OLE DB

SNC SQL Native Client for Microsoft SQL Server

MSOLEDBSQL Microsoft OLE DB Driver for SQL Server

Syntax

Provider='provider_name'

Default value

None

Usage

Select a data provider from the list of installed data providers displayed in the Provider drop-down list. For example, if you are using Microsoft's OLE DB Provider for ODBC, select MSDASQL as the Provider value. If you are using Microsoft's OLE DB Provider for SQL Server, select SQLOLEDB as the Provider value.

SNC SQL Native Client driver

The Provider DBParm parameter for the Microsoft SQL Native Client (SNC) interface allows you to select the SNC version that you want to use for a database connection. You can set this parameter in script to SQLNCLI (for the SNC 9.0 driver that connects to SQL Server 2005) or to SQLNCLI10 (for the SNC 10.0 driver that connects to SQL Server 2008) or to SNC 11 (for the SNC 11 driver that connects to SQL Server 2012 or later). Otherwise, you can select one of these providers on the Connection tab of the Database Profile Setup dialog box for the SNC interface.

If you do not set or select a provider, the default selection is SQLNCLI (SNC 9.0 for SQL Server 2005). This allows existing SNC interface users to be able to upgrade to the current release of PowerBuilder without any modifications. If PowerBuilder fails to connect with the SQLNCLI provider, it will attempt to connect to SQLNCLI10 provider. However, if you explicitly set the provider and the connection fails, PowerBuilder displays an error message.

Examples

Example 1

To use the Microsoft OLE DB Provider for ODBC to connect to the PB Demo DB:

  • Database profile

    Select MSDASQL from the Provider drop-down list on the Connection page in the Database Profile Setup dialog box for OLE DB.

  • Application

    Type the following in code:

    SQLCA.DBParm="Provider='MSDASQL'"

Example 2

To use the Microsoft OLE DB Provider for Oracle to connect to an Oracle 8 database:

  • Database profile

    Select MSDAORA from the Provider drop-down list on the Connection page in the Database Profile Setup dialog box.

  • Application

    Type the following in code:

    SQLCA.DBParm="Provider='MSDAORA'"

Example 3

To use the ADO.NET Provider to connect to an Oracle 8 database:

  • Database profile

    Select Oracle from the Provider drop-down list on the Connection page in the Database Profile Setup dialog box for ADO.NET.

  • Application

    Type the following in code:

    SQLCA.DBParm="PROVIDER='Oracle'"

Example 4

To use the Microsoft SNC software to connect to a Microsoft SQL Server 2016 database:

  • Database profile

    Select SQLNCLI11 from the Provider drop-down list on the Connection page in the Database Profile Setup dialog box.

  • Application

    Type the following in code:

    SQLCA.DBParm="Provider='SQLNCLI11'"

Example 5

To use the ADO.NET custom driver to connect to a MySQL database:

  • Database profile

    Select Custom Driver from the Provider drop-down list and specify the full path of the driver on the Connection page in the Database Profile Setup dialog box for ADO.NET.

  • Application

    Type the following in code:

    SQLCA.DBParm="Provider='Custom Driver',DriverFile='D:\mysql\mysqlconnector.2.4.0\lib\net8.0\MySqlConnector.dll'"

See also

DataLink

DataSource