Database connections

If you are deploying an executable or component that accesses a database, your users need access to the DBMS and to the database your application uses.

Where to install database connectivity files

You do not need to deploy database connectivity files with a client application that relies on a middle-tier component on another computer to perform database transactions. Database connectivity files must be deployed on the computer that interacts with the database server.

You need to:

  • If necessary, install the DBMS runtime (client) files in the application directory or in a directory on the system path

    If your application uses a standalone SQL Anywhere database, you can install the SQL Anywhere Runtime Edition files on the user's computer. For more information, see SQL Anywhere files. Otherwise follow the instructions and licensing rules specified by the vendor.

  • Make sure each user has access to the database the application uses

    If your application uses a local database, install the database and any associated files, such as a log file, on the user's computer.

    If your application uses a server database, make sure the user's computer is set up to access the database. This may be the task of a database administrator.

  • Install any database interfaces your application uses on the user's computer

  • If your application uses the ODBC interface, configure the ODBC database drivers and data sources, as described in Configuring ODBC data sources and drivers

For more information about database drivers and interfaces, see:

Native database drivers

The following table lists the native database drivers supplied with PowerBuilder. If an application or component uses the database specified, the file is required on the computer. The first two characters of the native database file name are PB, the next three characters identify the database, and the last two identify the version of PowerBuilder.

Name

Required for

pbin9.dll

Informix v9.x Interface (IN9)

pbi10.dll

Informix v10.x/v12.x/v14.x Interface (I10)

pbo90.dll

Oracle 9i (O90)

pbo10.dll

Oracle 10g (O10)

pbora.dll

Oracle 11g and later (ORA)

pbmsoledbsql.dll

Microsoft OLE DB Driver for SQL Server

pbsnc.dll

SQL Native Client for Microsoft SQL Server (SNC)

pbase.dll

Adaptive Server Enterprise CT-LIB for Adaptive Server 15.x & 16.x (ASE)

pbsyc.dll

Adaptive Server Enterprise CT-LIB (SYC)


Installed path

%systemdrive%\Program Files (x86)\Appeon\Common\PowerBuilder\Runtime [version]\

Deployment path

Same directory as the application, in a directory on the system path, or in the App Path registry key.

Registry entries

See App Path registry key.

ODBC database drivers and supporting files

This section lists files that are required for all ODBC database connections from PowerBuilder or InfoMaker applications, as well as files required for a specific database interface or DBMS.

PowerBuilder ODBC interface files

The following PowerBuilder ODBC interface files are required if your application uses ODBC:

Name

Description

pbodb.dll

PowerBuilder ODBC interface

pbodb.ini

PowerBuilder ODBC initialization file


Installed path

%systemdrive%\Program Files (x86)\Appeon\Common\PowerBuilder\Runtime [version]\

Deployment path

Same directory as the application, in a directory on the system path, or in the App Path registry key.

Registry entries

See App Path registry key.

Notes

The PBODB.ini file must be in a directory defined by the HKEY_CURRENT_USER\Software\sybase\PowerBuilder\22.0\InitPath registry setting or, in the absence of that key, in the same directory as the DLL file. In most cases, the target deployment machine will not have the registry setting and, therefore, the INI file should be in the same directory as the DLL.

Microsoft ODBC files

The following table lists the Microsoft ODBC files that are required if your application uses ODBC.

Name

Description

ODBC32.dll

ODBCAD32.exe

ODBCCP32.lib

ODBCCP32.dll

ODBCCR32.dll

ODBCINST.chm

ODBCINT.dll

ODBCTRAC.dll

Microsoft ODBC driver manager, DLLs, and Help files


Installed path

Windows system directory.

Deployment path

Windows system directory.

Registry entries

None.

Notes

The Microsoft ODBC Driver Manager (ODBC32.dll) and supporting files are usually already installed in the user's Windows system directory.

SQL Anywhere files

If your PowerBuilder application uses a SQL Anywhere database, you need to deploy the SQL Anywhere DBMS as well as SQL Anywhere's ODBC database drivers.

Restrictions

If your application requires the data definition language (DDL), a transaction log, stored procedures, or triggers, see your sales representative.

The following table lists some of the files that are installed with SQL Anywhere. For more information see the SQL Anywhere documentation.

Name

Description

dbodbc[xx].dll

SQL Anywhere ODBC driver

dbbackup.exe

SQL Anywhere backup utility

dbcon[xx].dll

Connection dialog box, required if you do not provide your own dialog box and your end users are to create their own data sources, if they need to enter user IDs and passwords when connecting to the database, or if they need to display the Connection dialog box for any other purpose

dbisqlc.exe

Interactive SQL utility

dblgen[xx].dll

Language-specific string library (EN indicates the English version)

dblib[xx].dll

Interface library

dbtool[xx].dll

SQL Anywhere database tools

dbunlspt.exe

SQL Anywhere unload utility

dbvalid.exe

SQL Anywhere validation utility

dbctrs[xx].dll

Performance utility

dbserv[xx].dll

Server utility


Installed path

\Program Files\SQL Anywhere [xx]\bin32 or \bin64

Deployment path

Same directory as the application, in a directory on the system path, or in the App Path registry key.

Registry entries

See App Path registry key and Configuring ODBC data sources and drivers.

Privilege requirements on Windows

When running under User Account Control, some SQL Anywhere executables require elevated privileges. For Windows 10 and later versions of Windows, you can use the SQL Anywhere elevated operations agent (dbelevate[xx].exe) to elevate the privileges of users running these executables and allow non-elevated client processes to autostart elevated servers or database engines. The following DLLs require elevated privileges when they are registered and unregistered: dbcon[xx].dll, dbctrs[xx].dll, and dbodbc[xx].dll.

Notes

Supporting files should be installed in the same directory as dbodbc11.dll. If you are not using the English string library, make sure you deploy the appropriate version of the language-specific string library.

Configuring ODBC data sources and drivers

ODBC.INI

To allow the user to connect to a particular data source, your installation program must provide a definition for that data source in the ODBC.INI key in the registry on the computer that accesses the data source, in HKEY_CURRENT_USER for a user DSN or in HKEY_LOCAL_MACHINE for a system DSN. The data source definition specifies the name and location of the database driver as well as the command required to start the database engine. The data source in the ODBC Data Sources key must also be listed in ODBC.INI.

The following shows typical registry entries for a data source called MyApp DB that uses SQL Anywhere. Registry keys are enclosed in square brackets and are followed by string values for that key in the format "Name"="Value":

[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\MyApp DB]
"Driver"="C:\Program Files\SQL Anywhere 16\bin32\dbodbc16.dll"
"Start"="c:\program files\SQL Anywhere 16\bin32\dbeng16.exe -c9m"
"UID"="dba"
"PWD"="sql"
"Description"="Database for my application"
"DatabaseFile"="C:\Program Files\myapps\myapp.db"
"AutoStop"="Yes"

[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
"MyApp DB"="SQL Anywhere 16.0"

ODBCINST.INI

Your installation program needs to make two types of entry in the ODBCINST.INI key in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC for each driver that your deployed application uses:

  • Add a string value with the name of the driver and the data value "Installed" to the ODBC DRIVERS key in ODBCINST.INI

  • Add a new key for each driver to the ODBCINST.INI key with string values for Driver and Setup

    Some drivers require additional string values in ODBCINST.INI.

If the ODBC database driver files are not located in a directory on the system path, you also need to add their location to the App Paths key for the executable file.

If you are using ODBC drivers obtained from a vendor, you can use the driver's setup program to install the driver and create registry entries.

The following shows a typical registry entry for SQL Anywhere. A registry key is enclosed in square brackets and is followed by string values for the key in the format "Name"="Value":

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\SQL Anywhere 16.0]
"Driver"="c:\program files\SQL Anywhere 16\bin32\dbodbc16.dll"
"Setup"="c:\program files\SQL Anywhere 16\bin32\dbodbc16.dll"

For more information about the contents of the registry entries for ODBC drivers and data sources, see the section called “How PowerBuilder accesses the data source” in Connecting to Your Database.

OLE DB database providers

If your application uses OLE DB to access data, you must install Microsoft's Data Access Components software on each user's computer if it is not installed already.

The PowerBuilder OLE DB interface requires the functionality of the Microsoft Data Access Components (MDAC) version 2.8 or later software.

To check the version of MDAC on a computer, users can download and run the MDAC Component Checker utility from the MDAC Downloads page at https://msdn.microsoft.com/en-us/data/aa937730.aspx.

On the Windows 10 operating systems, the Windows Data Access Components (DAC) version 6.0 replaces MDAC, and implements the functionality requirements of the PowerBuilder OLE DB interface.

OLE DB data providers

Several Microsoft OLE DB data providers are automatically installed with MDAC and DAC, including the OLE DB Provider for SQL Server (SQLOLEDB) and OLE DB Provider for ODBC (MSDASQL).

OLE DB Provider for SQL Server (SQLOLEDB) is not maintained any more and it is not recommended to use it for new development work. Instead, use the new OLE DB Driver for SQL Server (MSOLEDBSQL) which will be updated with the most recent server features. The new OLE DB Driver for SQL Server (MSOLEDBSQL) must be used with the "MSOLEDBSQL SQL Server" interface (instead of the "OLE Microsoft OLE DB" interface) installed with PowerBuilder.

PowerBuilder OLE DB interface files

The PowerBuilder OLE DB interface file is required if your application uses OLE DB. The ODBC initialization file is required if you have used it to customize OLE DB settings:

Name

Description

pbole.dll

PowerBuilder OLE DB interface

pbodb.ini

PowerBuilder ODBC initialization file


Installed path

%systemdrive%\Program Files (x86)\Appeon\Common\PowerBuilder\Runtime [version]\

Deployment path

Same directory as the application, in a directory on the system path, or in the App Path registry key.

Registry entries

See App Path registry key.

Notes

The INI and DLL files must be in the same directory. If you have modified the pbodb.ini file, make sure you deploy the modified version.

ADO.NET database providers

The PowerBuilder ADO.NET interface supports ODBC, Oracle and Microsoft SQL Server. If you use ADO.NET, you must deploy the common DLLs including pbDBDriver.dll, Appeon.DB.Proxy.dll, Appeon.DB.Proxy.runtimeconfig.json, Appeon.DB.Proxy.deps.json, Appeon.DB.Base.dll and Appeon.DB.Base.deps.json, and the other DLLs for each database.

Note

.NET Desktop Runtime 6.0 must be installed to the client to support the database connection with ADO.NET.

You will need to manually package and distribute .NET Desktop Runtime 6.0 as the runtime packager will not include these files.

Name

Description

pbDBDriver.dll

Appeon.DB.Proxy.dll

Appeon.DB.Proxy.runtimeconfig.json

Appeon.DB.Proxy.deps.json

Appeon.DB.Base.dll

Appeon.DB.Base.deps.json

Appeon.DB.Odbc.dll

Appeon.DB.Odbc.deps.json

System.Data.Odbc.dll

PowerBuilder ADO.NET ODBC interface

pbDBDriver.dll

Appeon.DB.Proxy.dll

Appeon.DB.Proxy.runtimeconfig.json

Appeon.DB.Proxy.deps.json

Appeon.DB.Base.dll

Appeon.DB.Base.deps.json

Appeon.DB.Oracle.dll

Appeon.DB.Oracle.deps.json

Microsoft.Win32.SystemEvents.dll

System.Configuration.ConfigurationManager.dll

System.Diagnostics.PerformanceCounter.dll

System.DirectoryServices.dll

System.DirectoryServices.Protocols.dll

System.Drawing.Common.dll

System.Security.Cryptography.ProtectedData.dll

System.Security.Permissions.dll

System.Windows.Extensions.dll

Oracle.ManagedDataAccess.dll

PowerBuilder ADO.NET Oracle interface

pbDBDriver.dll

Appeon.DB.Proxy.dll

Appeon.DB.Proxy.runtimeconfig.json

Appeon.DB.Proxy.deps.json

Appeon.DB.Base.dll

Appeon.DB.Base.deps.json

Appeon.DB.SQLServer.dll

Appeon.DB.SQLServer.deps.json

Microsoft.Data.SqlClient.dll

Microsoft.Data.SqlClient.SNI.dll

Microsoft.Identity.Client.dll

Microsoft.SqlServer.Server.dll

System.Configuration.ConfigurationManager.dll

System.Security.Permissions.dll

Azure.Core.dll

Azure.Identity.dll

Microsoft.Bcl.AsyncInterfaces.dll

Microsoft.Identity.Client.Extensions.Msal.dll

Microsoft.IdentityModel.Abstractions.dll

Microsoft.IdentityModel.JsonWebTokens.dll

Microsoft.IdentityModel.Logging.dll

Microsoft.IdentityModel.Protocols.dll

Microsoft.IdentityModel.Protocols.OpenIdConnect.dll

Microsoft.IdentityModel.Tokens.dll

Microsoft.Win32.SystemEvents.dll

System.Drawing.Common.dll

System.IdentityModel.Tokens.Jwt.dll

System.Memory.Data.dll

System.Runtime.Caching.dll

System.Security.Cryptography.ProtectedData.dll

System.Windows.Extensions.dll

PowerBuilder ADO.NET SQL Server interface