Copyright: Copyright (C) 1996 Lotus Development Corporation


Logon to Sybase Server dialog box

Server Name

Type the name of the server containing the Sybase Server database tables you want to access (case-sensitive) or select the name from Server Name box, which displays the server names you specified in the Setup dialog box.

Login ID

 If required, type your Login ID (case-sensitive).

Password

 If required, type your password for the system (case-sensitive).

Database

Enter the name of the database you wish to access or select the name from the Database box.

 See related topics


Connecting to Sybase System 10 and 11 using a connection string

If your application requires a connection string to connect to a data source, you must specify the data source name that tells the driver which ODBC.INI section of the registry to use for the default connection information.  Optionally, you may specify attribute=value pairs in the connection string to override the default values stored in the ODBC.INI section of the registry.

You can specify either long or short names in the connection string.  The connection string has the form:

DSN=data_source_name[;attribute=value[;attribute=value]...]

An example of a connection string for Sybase System 10 is

DSN=Accounting;DB=PAYROLL;UID=JOHN;PWD=XYZZY

The following table gives the long and short names for each attribute, as well as a description.

The defaults listed in the table are initial defaults that apply when no value is specified in either the connection string or the data source definition in the ODBC.INI section of the registry. If you specified a value for the attribute when configuring the data source, that value is your default.

Attribute	Description
DataSourceName (DSN)	A string that identifies a single connection to a Sybase System 10 or 11 database.  Examples include "Accounting" or "Sys10-Serv1."
ServerName (SRVR)	The name of the server containing the Sybase System10 or 11  tables you want to access. If not supplied, the initial default is the server name in the DSQUERY environment variable.
LogonID (UID)	The default logon ID used to connect to your Sybase System 10 or 11 database. This ID is case-sensitive. A logon ID is required only if security is enabled on your database.  If so, contact your system administrator to get your logon ID.
Password (PWD)	A case-sensitive password.
Database (DB)	The name of the database to which you want to connect.
Language (LANG)	The national language corresponding to a subdirectory in $SYBASE/locales.
Charset (CS)	The name of a character set corresponding to a subdirectory in $SYBASE/charsets.
WorkstationID (WKID)	The workstation ID used by the client.
ApplicationName (APP)	The name used by Sybase System 10 to identify your application.
InterfacesFile (IFILE)	The pathname to the interfaces file.
ArraySize (AS)	The number of rows the driver retrieves from the server for a fetch. This is not the number of rows given to the user. This increases performance by reducing network traffic. The initial default is 10 rows.
OptimizePrepare (OP)	OptimizePrepare={0 | 1 | 2}.  A value that determines whether stored procedures are created on the server for every call to SQLPrepare. When set to 0, stored procedures are created for every call to SQLPrepare. This setting can result in bad performance.  When set to 1, the initial default, the driver creates stored procedures only if the statement contains parameters. Otherwise, the statement is cached and executed directly at SQLExecute time. When set to 2, the driver never creates stored procedures.
SelectMethod (SM)	SelectMethod={0 | 1}. A value that determines whether database cursors are used for Select statements. When set to 0, the initial default, database cursors are used. In some cases performance degradation can occur when performing large numbers of sequential Select statements because of the amount of overhead associated with creating database cursors.  When set to 1, Select statements are executed directly without using database cursors. When set to 1, the data source is limited to one active statement and one active connection.
PasswordEncryption (PE)	Password Encryption={0 | 1}. A number that determines whether password encryption can be performed from the Open Client Library to the server (PasswordEncryption=1). When set to 0, the default, this cannot be done.
PacketSize (PS)	PacketSize={-1 | 0 | x}. A number that determines the number of bytes per network packet transferred from the database server to the client. The correct setting of this attribute can improve performance. When set to 0, the initial default, the driver uses the default packet size as specified in the System 10 or 11 server configuration. When set to -1, the driver computes the maximum allowable packet size on the first connect to the data source and save the value in the odbc.ini file. When set to x, an integer from 1 to 10, which indicates a multiple of 512 bytes (for example, PacketSize=6 means to set the packet size to 6 * 512 = 3072 bytes). For you to take advantage of this connection attribute, you must configure the System 10 or 11 server for a maximum network packet size greater than or equal to the value you specified for PacketSize. For example: sp_configure “maximum network packet size”, 5120 reconfigure Restart System 10 Server Note that the ODBC specification specifies a connect option, SQL_PACKET_SIZE, that offers this same functionality. To avoid conflicts with applications that may set both the connection string attribute and the ODBC connect option, they have been defined as mutually exclusive. If PacketSize is specified, you will receive a message “Driver Not Capable” if you attempt to call SQL_PACKET_SIZE. If you do not set PacketSize, then application calls to SQL_PACKET_SIZE are accepted by the driver.
CursorCacheSize (CCS)	A value that determines the number of connections that the connection cache can hold. The default CursorCacheSize setting is 1. To set the connection cache, you must set the SelectMethod option to 1. Increasing the connection cache may increase performance of some applications, but requires additional database resources.


Connecting to Sybase System 10 and 11 using a Logon dialog box

Some ODBC applications display a logon dialog box when you are connecting to a data source.  In these cases, the data source name has already been specified.

In the Logon dialog box, do the following:

1.	Type the case-sensitive name of the server containing the Sybase System 10 or 11 database tables you want to access, or select the name from the Server Name drop-down box, which displays the server names you specified in the setup dialog box.

2.	If required, type your case-sensitive login ID.

3.	If required, type your case-sensitive password for the system.

4.	Type the name of the database you want to access (case-sensitive) or select the name from the Database drop-down box, which displays the names you specified in the Setup dialog box.

5.	Click OK to complete the logon and update the values in ODBC.INI.


INTERSOLV copyright notice

Copyright 1995 INTERSOLV Inc. All rights reserved. INTERSOLV is a registered trademark, and DataDirect is a trademark of INTERSOLV, Inc. Other company or product names mentioned herein may be trademarks or registered trademarks of their respective companies.


ODBC Sybase System 10 Advanced Driver Setup dialog box

To configure optional settings for a System 10 data source, specify values as follows:

Server List

The list of servers that will appear in the logon dialog box. Separate the server names with commas.

Database Name

The name of the database to which you want to connect by default. If you do not specify a value, the default is the database defined by the system administrator for each user.  You can select the name from the Database Name box.

Database List

The databases that will be available in the System 10 Server Logon Options dialog box. Separate the names with commas.

Default Logon ID

The default logon ID used to connect to your Sybase database. This ID is case-sensitive. A logon ID is required only if security is enabled on your database. Your ODBC application may override this value or you may override this value in the logon dialog box or connection string.

Interfaces File

The pathname to the interfaces file. The default is the normal Sybase interfaces file.

Password Encryption

A number that determines whether password encryption can be performed from the Open Client Library to the server (PasswordEncryption=1). When set to 0, the default, this cannot be done.

Charset

The name of a character set corresponding to a subdirectory in $SYBASE/charsets. The default is the setting on the System 10 server.

Workstation ID

The workstation ID used by the client.

Language

The national language to be used by the client. The default is English.

Application Name

The name Sybase System 10 or 11 is used to identify your application.

Yield Proc

 A numeric value that determines whether you can work in other applications when Sybase System 10 or 11 is busy.  This attribute is useful to users of ODBC applications.  Valid values are:

•	0 (peek and dispatch), which causes the driver to check the Windows message queue and send any messages to the appropriate Windows application.

•	1 (no yielding, the default), which does not let you work in non-Windows applications.

•	3 (dispatch via Windows Yield function), which turns control over to the Windows kernel.  The Windows kernel checks the message queue and sends any messages to the appropriate application window.

This attribute is not available for editing in Windows NT or Windows 95. YieldProc is set to 1 as the default. This lets you work in other Windows applications when Sybase System 10 or 11 is busy. If YieldProc=0, 2, or 3 then you cannot work in other Windows applications when Sybase System 10 or 11 is busy.

Close

Returns to the System 10 ODBC Setup dialog box where you can click the OK button to write these settings to the ODBC.INI file.

Translate

Displays the Select Translator dialog box to allow you to perform a translation of data from one character set to another. Select the OEM to ANSI translator to translate data from the IBM PC character set to the ANSI translator set.

Performance

Displays the ODBC Sybase System 10 Performance Setup dialog box to configure optional performance settings for this data source.


Configuring data sources

To configure data sources for Sybase System 10 or 11 do the following:

1.	Start the ODBC Administrator by running ODBCAD32.EXE.

A list of data sources appears.

2.	If you are configuring a new data source, click Add.

A list of installed drivers appears.

3.	Select INTERSOLV OEM 2.12 32-BIT Sybase System 10 and click OK.

4.	If you are configuring an existing data source, select the data source name and click Setup.

The ODBC System10 Driver Setup dialog box appears.

5.	Specify a data source name and a server name.

6.	(Optional) Enter a description.

7.	Click Advanced to configure optional data source settings, such as server list and database list.

The ODBC Sybase System 10 Advanced Driver Setup dialog box appears.

8.	Enter any optional data source settings.

9.	To configure advanced performance options, click Performance.

The ODBC Sybase System 10 Performance Setup dialog box appears.

10.	Enter any performance option settings.

11.	Click Close to return to the Advanced Setup dialog box.

12.	Click Translate at the ODBC Advanced Driver Setup dialog box to perform a translation of your data from one character set to another.

The Select Translator dialog box appears, in which you select a translator. INTERSOLV provides a translator named OEM to ANSI that translates data from the IBM PC character set to the ANSI character set. The translators that are listed in this dialog box are determined by the values listed in the ODBC Translators section of ODBCINST.INI.

13.	Click OK to close the Select Translator dialog box and perform the translation.

14.	Click OK to write these values to the ODBC.INI section of the registry.

These values are now the defaults when you connect to the data source. You can change the defaults by configuring your data source again. You can override the defaults by connecting to the data source using a connection string with alternate values.


Data types

The  Sybase System 10 and 11 data types are mapped to the standard ODBC data types as follows:

SQL Server	ODBC Data Type
binary	SQL_BINARY
bit	SQL_BIT
char	SQL_CHAR
datetime	SQL_TIMESTAMP
decimal	SQL_DECIMAL
float	SQL_FLOAT
image	SQL_LONGVARBINARY
int	SQL_INTEGER
money	SQL_DECIMAL
numeric	SQL_NUMERIC
real	SQL_REAL
smalldatetime	SQL_TIMESTAMP
smallint	SQL_SMALLINT
smallmoney	SQL_DECIMAL
sysname	SQL_VARCHAR
text	SQL_LONGVARCHAR
timestamp	SQL_VARBINARY
tinyint	SQL_TINYINT
varbinary	SQL_VARBINARY
varchar	SQL_VARCHAR
Note	 The nchar, nvarchar, sensitivity, and sensitivity_boundary data types are not supported.


Isolation and lock levels supported

Sybase System 10 and 11 both support isolation levels 1 (read committed, the default) and 3 (serializable). It also supports page-level locking.


Number of connections and statements supported

The Sybase System 10 and 11 database systems support multiple connections and multiple statements per connection.


ODBC conformance levels

The Sybase System 10 driver supports the Core, Level 1, and Level 2 API functions listed in Supported ODBC Functions.  In addition, the following Level 2 functions are supported:

•	SQLBrowseConnect

•	SQLColumnPrivileges

•	SQLForeignKeys

•	SQLPrimaryKeys

•	SQLProcedureColumns

•	SQLProcedures

•	SQLTablePrivileges

The driver supports the minimum SQL grammar.


ODBC Sybase System 10 Performance Setup dialog box

To configure optional performance settings for this data source, specify values as follows:

Prepare Method

 A value that determines whether stored procedures are created on the server for every call to SQLPrepare. When set to 0, stored procedures are created for every call to SQLPrepare. This setting can result in bad performance.

When set to 1, the initial default, the driver creates stored procedures only if the statement contains parameters. Otherwise, the statement is cached and executed directly at SQLExecute time. When set to 2, the driver never creates stored procedures.

Fetch Array Size

The number of rows the driver retrieves from the server for each fetch. This is not the number of rows given to the user. This increases performance by reducing network traffic. The initial default is 10 rows.

Select Method

A value that determines whether database cursors are used for Select statements. When set to 0, the initial default, database cursors are used. In some cases performance degradation can occur when performing large numbers of sequential Select statements because of the amount of overhead associated with creating database cursors.

When set to 1, Select statements are executed directly without using database cursors. When set to 1, the data source is limited to one active statement and one active connection. This setting may increase performance in some applications.

Packet Size

A value that determines the number of bytes per network packet transferred from the database server to the client. The correct setting of this attribute can improve performance.

When set to 0, the initial default, the driver uses the default packet size as specified in the System 10 or 11 server configuration.

When set to -1, the driver computes the maximum allowable packet size on the first connect to the data source and save the value in the ODBC.INI file.

When set to x, an integer from 1 to 10, which indicates a multiple of 512 bytes (for example, PacketSize=6 means to set the packet size to 6 * 512 = 3072 bytes).

For you to take advantage of this connection attribute, you must configure the System 10 or 11 server for a maximum network packet size greater than or equal to the value you specified for PacketSize. For example:

sp_configure "maximum network packet size", 5120

reconfigure

Restart System 10 Server

Note that the ODBC specification specifies a connect option, SQL_PACKET_SIZE, that offers this same functionality. To avoid conflicts with applications that may set both the connection string attribute and the ODBC connect option, they have been defined as mutually exclusive. If PacketSize is specified, you will receive a message “Driver Not Capable” if you attempt to call SQL_PACKET_SIZE. If you do not set Packet Size, then application calls to SQL_PACKET_SIZE are accepted by the driver.

Connection Cache

A value that determines the number of connections that the connection cache can hold. The default Connection Cache setting is 1. To set the connection cache, you must set the Select Method option to -1 Direct. Increasing the connection cache may increase performance of some applications, but requires additional database resources.

Close

Returns to the ODBC Sybase System 10 Advanced Driver Setup dialog box where you can click the OK button to write these settings to the ODBC.INI file.


System requirements

To gain access to Sybase System 10 or 11, you must install the appropriate Sybase Net-Library and the Sybase Open Client-Library, version 10.03 or later for Windows NT, including the following DLLs:

•	  LIBCS.DLL

•	LIBCOMN.DLL

•	LIBCT.DLL

•	LIBINTL.DLL

•	LIBTCL.DLL

Set the environment variable SYBASE to the directory where you have installed the SYBASE client. You set this environment variable in the Control Panel under System. For example:

SET SYBASE=C:\SQL10

SYBPING is a tool provided with Sybase net-libraries to test connectivity from your client workstation to the database server (servers that are added using SQLEdit). Use this tool to test your connection.


About the Sybase System 10 Driver

The Sybase System 10 driver supports the Sybase System 10 and 11 database systems from Sybase, Inc.

The driver filename is LOSYB09.DLL.

Copyright


ODBC Sybase System 10 Driver Setup dialog box

Use the ODBC Sybase System 10 Driver Setup dialog to create new System 10 data sources or configure existing data sources.

Data Source Name

A string that identifies this Sybase data source configuration in the ODBC.INI section of the registry.  Examples include "Accounting" or "Sybase-Serv1."

Description

An optional long description of a data source name.  For example, "My Accounting Database" or "Sybase on Server number 1."

Server Name

The name of the server that contains the System 10 tables you want to access. If not supplied, the server name in the DSQUERY environment is used.

Advanced

Displays the ODBC Sybase System 10 Advanced Driver Setup dialog box to configure optional data source settinigs, such as server name.

OK

Creates or modifies the current data source using the options you specify.

Cancel

Exits the ODBC Setup dialog box without creating or modifying a data source.

 See related topics