|
This section describes how to use the Powersoft Sybase SQL Server System 10 database interface in PowerBuilder or InfoMaker.
You may also wish to read the description of Using embedded SQL with Sybase SQL Server System 10.
Client Library API
The Powersoft Sybase SQL Server System 10 database interface (PBSYC040.DLL) uses the Client Library (CT-Lib) application programming interface (API) to access the database.
When you connect to a Sybase System 10 database, PowerBuilder or InfoMaker makes the required calls to the API. Therefore, you do not need to know anything about CT-Lib to use the database interface.
If you want to use the DB-Library (DBLIB) API to access a SQL Server database, you must install the Powersoft SQL Server database interface (PBSYB040.DLL) .
Supported versions
You can access Sybase SQL Server Release 10.0.1 or higher using PowerBuilder or InfoMaker.
Supported data types
PowerBuilder and InfoMaker support the following Sybase SQL Server System 10 data types in DataWindows, reports, and embedded SQL:
|
Binary
|
Money
|
|
Bit
|
Numeric
|
|
Char (less than 255 characters)
|
Real
|
|
DateTime
|
SmallDateTime
|
|
Decimal
|
SmallInt
|
|
Double precision
|
SmallMoney
|
|
Float
|
Text
|
|
Identity
|
TinyInt
|
|
Image
|
VarBinary
|
|
Int
|
VarChar
|
Data type conversion When you retrieve or update columns, PowerBuilder or InfoMaker converts data appropriately between the Sybase SQL Server System 10 data type and the Powersoft data type.
A double that has no fractional component is converted to a string with one decimal place if the converted string would cause Sybase SQL Server System 10 to have an overflow error when parsing the string. For example, the double string 12345678901234 would cause an overflow error so it is converted to 12345678901234.0.
Preparing to use the database
Before you define the interface and connect to a Sybase SQL Server System 10 database from PowerBuilder or InfoMaker, follow these steps to prepare the database.
To prepare a Sybase SQL Server System 10 database:
- Install the database server software, following the instructions in your Sybase SQL Server System 10 documentation.
You must obtain the database server software from Sybase Corporation.
- Make sure the appropriate network software is installed at your site and properly configured for your environment.
Sybase SQL Server System 10 requires the use of a Windows Sockets compliant TCP/IP network protocol.
You must obtain the network software from your network vendor.
- Install the following client software on your computer:
- Sybase Open Client Client-Library for Windows, Release 10.0.1 or higher
- Sybase Net-Library for Windows, Release 10.0.1 or higher, including the Windows Sockets Driver
- Windows Sockets compliant TCP/IP software
The Open Client software includes the file WCTLIB.DLL, which contains the CT-Library programs. The Powersoft Sybase System 10 interface communicates with the database through WCTLIB.DLL. WCTLIB communicates with the Sybase Net-Library DLL (WNLWNSCK.DLL) installed on your computer.
You must obtain the Open Client and Net-Library software from Sybase, and the TCP/IP client software from your network vendor.
- Install the Powersoft Sybase SQL Server System 10 database interface (PBSYC040.DLL) on your computer.
- Make sure the SQL.INI configuration file for the Sybase Open Client software is correctly configured for your environment.
The SQL.INI file is installed by default in the \INI subdirectory of your Sybase System 10 product directory. It should contain an entry for each SQL Server database server that you want to access. Each entry should include the following information:
- Server name
- Sybase Net-Library for Windows driver (DLL) name
- Server Internet address or alias name
- TCP/IP port number
The basic format of an entry in the SQL.INI file is as follows:
[server_name] WIN3_QUERY=driver,address,port_number
Here is a sample entry in the SQL.INI file for a database server named Sales. WNLWNSCK is the Windows Sockets Net-Library driver, 192.1.200.27 is the server's Internet address, and 5001 is the server's port number.
[sales] WIN3_QUERY=wnlwnsck,192.1.200.27,5001
When you connect to Sybase System 10, PowerBuilder or InfoMaker passes information from your database profile to WCTLIB.DLL. This information includes the database server name, which must match the server name specified in the SQL.INI file.
WCTLIB then checks the SQL.INI file to find the corresponding entry for this server name to determine how to connect to it. When WCTLIB finds the appropriate entry, it loads the specified Net-Library driver and connects to the database.
- Run the PBSYB.SQL and PBSYC.SQL scripts outside PowerBuilder or InfoMaker to install required Powersoft stored procedures in the master database.
- Make sure you can connect to the database server and to the SQL Server System 10 database you want to access from outside PowerBuilder or InfoMaker.
To verify the connection, use the WSYBPING utility to check that you can reach the database server from your computer. WSYBPING is a network diagnostic utility included with the Sybase Net-Library for Windows software. The WSYBPING utility detects whether the process you want to access is listening at the specified Internet address.
- Start Windows on your computer.
Defining the database interface
The following table lists the values you should supply for each field in the Database Profile Setup dialog box when defining the Powersoft SQL Server System 10 database interface.
|
Field
|
Value
|
|
Profile Name
|
The name of your database profile.
|
|
DBMS
|
SYC - Sybase System 10
|
|
User ID
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Password
|
Not applicable for use with PowerBuilder or InfoMaker.
|
|
Database Name
|
The name of the SQL Server System 10 database you want to access.
|
|
Prompt for Database information during Connect
|
Select this checkbox if you want to be prompted for connection information when creating or selecting a profile to connect to the database.
|
|
Server Name
|
The name of the SQL Server System 10 database server. This name must match the server name specified in your SQL.INI configuration file.
|
|
Login ID
|
The login ID of your database server.
In order to properly create the Powersoft repository tables, make sure the first person to connect to the database has sufficient authority to create tables and grant permissions to public.
|
|
Login Password
|
The login password of your database server. The actual password does not display in this field. Small Xs appear in place of the characters you type.
|
|
DBParm
|
Specify DBMS-specific connection parameters in this field.
|
|