Borland SQL Link: Connecting to SQL Server

To get help on an item, click the underlined text. For an overview of what the SQL Link driver is and how it works, see Essentials first.

Essentials -- Read this section for a brief overview of Borland SQL Links for Windows.

Configuring the driver -- Follow these procedures to configure the SQL Link Sybase driver.

Creating an alias -- Information you need to create a Sybase alias.

Connecting to Sybase -- How to connect to the Sybase database through your IDAPI application.

Troubleshooting steps -- If you cannot establish a Sybase connection, follow these steps to try to isolate the problem.


SQL Link Essentials
Essentials

Borland® SQL Links for Windows is a collection of drivers that let you work with SQL data through supported Borland applications. The SQL Link driver enables the connection to the SQL server, translates queries into the appropriate SQL dialect, and passes them to the SQL database. When processing is complete, the SQL database returns the answer to the client in a format that the desktop application can display.

Note:	Borland database applications also support the use of SQL statements against local (Paradox or dBASE) data. For information on how to use local SQL with your Borland database application, see your user documentation.

Supported Borland Applications

Borland SQL Links works with any application that supports the Borland Database Engine (also known as IDAPI, the Integrated Database Application Programming Interface). This includes Paradox for Windows, dBASE for Windows, Quattro Pro for Windows Database Desktop, and custom applications built using the Borland Database Engine.

Supported Databases

Drivers in the SQL Links product package support InterBase, Informix, ORACLE, and SYBASE and Microsoft SQL Server databases.


Configuring the SQL Link Driver for SYBASE
Configuring the SQL Link SYBASE Driver

Creating a SYBASE Alias

After SQL Link SYBASE driver installation is complete, the first thing you should do is configure the default parameters for the SYBASE driver itself.

Driver Name lists all the available drivers.

New Driver enables you to add an ODBC driver connection to the list of available drivers.

Delete Driver enables you to delete an ODBC driver connection from the list of available drivers.

Parameters shows all the parameters with their current values.

Description briefly notes the purpose of the selected parameter.

To configure the SYBASE driver, choose SYBASE as the Driver Name and highlight the desired configuration parameters. Delete the old value and enter a new one in the appropriate text box.

Setting	Meaning

VERSION	Internal version number of the SQL Link SYBASE driver.

TYPE	Type of server to which this driver helps you connect. Can be SERVER (SQL server) or FILE (standard, file-based server).

DLL	The name of the driver's Dynamic Link Library (SQLD_SS.DLL).

CONNECT TIMEOUT	Specifies the amount of time the workstation waits to attach to the server. Default: 60 seconds.

TIMEOUT	Specifies the maximum amount of time that the workstation waits for results to return from the server. Default: 300 seconds.

DRIVER FLAGS	Internal product-specific flag. Do not change without direct instructions from Borland support personnel.

DATABASE NAME	Name of the target SYBASE database.

SERVER NAME	Name of the target SYBASE SQL server.

USER NAME	Default name for accessing the SYBASE SQL server.

OPEN MODE	Mode in which SQL Link opens the SYBASE database. Can be READ/WRITE (default) or READ ONLY.

LANGDRIVER	Language driver used to display SQL data. (US. default=blank) Choose the language driver that matches your SYBASE server character set and collation sequence. If none of the language drivers supplied match, choose a language driver that matches the desired character set. [more]

SCHEMA CACHE SIZE	Number of SQL tables whose schema information will be cached. Can be any whole number from 0 to 32 (default = 8).

BLOB EDIT LOGGING	Enables or disables the logging of blob edits. Can be TRUE (default) or FALSE. When FALSE this option helps minimize blob space requirements and increase performance.

SQLQRYMODE	Method for handling queries to SQL data. Can be NULL (blank setting; default), SERVER, or LOCAL. [more]

SQLPASSTHRU MODE	Specifies whether or not the desktop application will be able to access the SYBASE SQL server via desktop queries and pass-through SQL queries in the same alias connection. Can be NOT SHARED, SHARED AUTOCOMMIT (default), or SHARED NO AUTOCOMMIT. [more]

DATE MODE	Format in which the SYBASE driver sends dates to the server. Must match the SYBASE server's DBDATE environment variable. Can be 0 (MDY; default), 1 (DMY), or 2 (YMD).

MAX QUERY TIME	Specifies the amount of time SQL Links will wait for query execution to complete before canceling the operation. Default: 3600 seconds.

SCHEMA CACHE TIME	Specifies how long table list information will be cached, in seconds. Can be -1, 0, or any integer from 1 through 2,147,483,647. [more]


The Alias Manager dialog box
Creating a SYBASE Alias

Use the Alias Page to add, delete, or modify a SYBASE alias.

Alias Name lists all the available aliases.

New Alias enables you to add a new alias.

Delete Alias enables you to delete any alias that is highlighted in the Alias Name box.

Parameters shows all the parameters with their current values.

Description briefly notes the purpose of the selected parameter.

The following parameters are displayed.

Setting	Meaning

TYPE	Type of server to which this driver helps you connect. Can be SERVER (SQL server) or FILE (standard, file-based server).

PATH	Reserved for future use.

DATABASE NAME	Name of the target SYBASE database.

SERVER NAME	Name of the target SYBASE SQL server.

USER NAME	Default name for accessing the SYBASE SQL server.

OPEN MODE	Mode in which SQL Link opens the SYBASE database. Can be READ/WRITE (default) or READ ONLY.

LANGDRIVER	Language driver used to display SQL data. (US. default=blank) Choose the language driver that matches your SYBASE server character set and collation sequence. If none of the language drivers supplied match, choose a language driver that matches the desired character set. [more]

SCHEMA CACHE SIZE	Number of SQL tables whose schema information will be cached. Can be any whole number from 0 to 32 (default=8).

BLOB EDIT LOGGING	Enables or disables the logging of blob edits. Can be TRUE (default) or FALSE. When FALSE this option helps minimize blob space requirements and increase performance.

SQLQRYMODE	Method for handling queries to SQL data. Can be NULL (blank setting; default), SERVER, or LOCAL. [more]

SQLPASSTHRU MODE	Specifies whether or not the desktop application will be able to access the SYBASE SQL server via desktop queries and pass-through SQL queries in the same alias connection. Can be NOT SHARED, SHARED AUTOCOMMIT (default), or SHARED NO AUTOCOMMIT. [more]

DATE MODE	Format in which the SYBASE driver sends dates to the server. Must match the SYBASE server's DBDATE environment variable. Can be 0 (MDY; default), 1 (DMY), or 2 (YMD).

SCHEMA CACHE TIME	Specifies how long table list information will be cached, in seconds. Can be -1, 0, or any integer from 1 through 2,147,483,647. [more]


Connecting to SYBASE
Connecting to SYBASE Through Your IDAPI Application

Troubleshooting your SYBASE connection

When you are within your IDAPI application you can connect to an Informix database either automatically (by performing a database action) or manually (without performing a database action).

The object of the connection process is to determine whether you have the right to access the database, and, if so, what kind of access permission you have (READ/WRITE or READ ONLY).

The connection is made through your Informix alias.

Connecting From Paradox for Windows or the Database Desktop

The first time you try to query or view a table in your Informix database through Paradox for Windows, SQL Link displays the Database Information dialog box. To complete the connection, enter your password in the Database Information dialog box and click OK.

If the connection is successful, your application continues with the operation you requested. The database to which you connected remains connected for the rest of the current session.

Connecting Manually

If you ever want to connect to a database without first performing a database action, you can connect manually through the Paradox Alias Manager:

1.	Select Files | Aliases to open the Alias Manager dialog box.

2.	Choose the desired alias from the drop-down list in the Database Alias field; the Alias Manager displays the configuration of the selected alias.

3.	Enter your password and choose Connect. If the connection is successful, the Alias Manager displays Connection is successful. Database is open.

4.	To close the Alias Manager dialog box, click OK.

Disconnecting Manually

To disconnect from the Informix server without exiting Paradox, redisplay the Alias Manager and choose Disconnect.

Connecting From dBASE for Windows

In dBASE for Windows, you cant connect to the Informix database without performing some kind of database action. However, you can start an action against the Informix database in either of the following ways:

From the Navigator

1.	Open the Navigator and click the Tables from Database button; dBASE displays a list of the available database aliases.

2.	Double-click on the desired alias; dBASE displays the Open Database dialog box.

3.	Enter your password in the Open Database dialog box, then click OK.

If the connection is successful, the Navigator displays the tables available through the selected database.

From File | Open

1.	Select File | Open to open the Open File dialog box.

2.	Click the Databases button. dBASE displays the Open Table dialog box, which lists the available database aliases.

3.	Double-click on the alias that connects with the desired database; dBASE displays the Open Database dialog box.

4.	Enter your password in the Open Database dialog box and click OK.

If the connection is successful, the Open Table dialog box displays a list of tables available in the database to which you just connected.


Troubleshooting Steps
Troubleshooting Your SYBASE Connection

If you have problems establishing an SQL Server connection with SQL Link, try to isolate the problem the following way:

1.	Use your SYBASE or Microsoft tools to verify the connection at each layer:

For SYBASE, use DBPING.EXE to check the network connection and ISQL.EXE to verify the server connection.

For Microsoft SQL Server, use the DOS system administrator facility (SAF.EXE) to verify the connection.

2.	Enter a valid query using either tool to verify your connection. For example:

select @@version

This query shows the server version number and verifies that you are connected to the server.

3.	Verify that the network layer is functioning by trying to share files and print jobs to the spooler.

4.	Use hardware diagnostics to make sure your network interface card is working properly.

For more information on your vendor-supplied diagnostic tools, see your SQL Server documentation.


Modifying a SYBASE Alias

To modify a SYBASE alias, highlight the alias and the parameter you want to change, then enter a new value in place of the old one.


Adding a New SYBASE Alias

To create a new SYBASE alias, click the New Alias button.which displays the Add New Alias dialog box. (The new alias starts with the default alias type: STANDARD.)

Enter a name for the new alias and select the SYBASE alias type.


Deleting a SYBASE Alias

To delete a SYBASE alias, highlight the alias you want to delete, then click the Delete Alias button. Reconfirm by clicking Yes in the Delete Alias dialog box.


LANGDRIVER Settings

Long driver name	Short name	Character set	Collation seq.
Paradox 'ascii'	ascii	DOS code page 437	Binary
Paradox 'intl'	intl	DOS code page 437	Paradox 'intl'
Paradox 'intl' 850	intl850	DOS code page 850	Paradox 'intl' 850
Paradox 'nordan'	nordan	DOS code page 865	Paradox 'nordan'
Paradox 'nordan40'	nordan40	DOS code page 865	Paradox 'nordan40'
Paradox 'swedfin'	swedfin	DOS code page 437	Paradox 'swedfin'
Paradox ANSI INTL	ANSIINTL	ISO8859.1 (ANSI)	Paradox 'intl'
Paradox ESP 437	SPANISH	DOS code page 437	Paradox ESP 437
Paradox ISL 861	iceland	DOS code page 861	Paradox ISL 861
Pdox ANSI INTL850	ANSII850	ISO8859.1 (ANSI)	Pdox 'intl' 850
Pdox ANSI NORDAN40	ANSINOR4	ISO 8859.1 (ANSI)	Pdox 'nordan40'
Pdox ANSI SWEDFIN	ANSISWFIN	ISO 8859.1 (ANSI)	Pdox 'swedfin'
PDox ESP ANSI	ANSISPAN	ISO 8859.1 (ANSI)	PDox ESP437
SQL Link ROMAN8	BLROM800	ROMAN8	Binary
Borland ENU Latin-1	BLLT1US0	ISO 8859.1 (ANSI)	Binary


SQLQRYMODE Settings

Setting	Meaning

NULL (blank setting)	Server-local mode (default). Query goes first to the SYBASE server. If the server is unable to perform the query, the query is performed at the desktop.

SERVER	Server-only mode. Query is sent to the SYBASE server. If the server is unable to perform the query, the query fails.

LOCAL	Local-only mode. Query is always performed at the desktop.


SQLPASSTHRU MODE Settings

Setting	Meaning
NOT SHARED  (blank setting)	Pass-through SQL and non-pass-through SQL do NOT share the same connection.
SHARED AUTOCOMMIT	(Default mode) Pass-through SQL and non-pass-through SQL will share the same connection, and (as long as you are not in an explicit client transaction or batch mode) pass-through SQL will be automatically committed.
SHARED NOAUTOCOMMIT	Pass-through SQL and non-pass-through SQL share the same connection, but pass-through statements will not be automatically committed.
For further information, see Connecting to SYBASE.


LOCK MODE Settings

Setting	Equiv. SQL statement	Meaning
-1	SET LOCK MODE TO WAIT	Suspends the process until the lock is released.
0	SET LOCK MODE TO NOT WAIT	Ends the operation immediately and returns an error code. This is the SYBASE default, which the Borland SQL Link driver now overrides.
1 - 32,776	SET LOCK MODE TO WAIT n	(Default=5) Suspends the process until the lock is released, or until the end of the specified number of seconds.*.
* In versions of SYBASE which do not support the seconds option, any non-zero value causes the process to wait until the lock is released.


SCHEMA CACHE TIME Settings

Setting	Meaning
-1	(Default). The table list is cached until you close the database.
0	No table lists are cached.
1 through 2147483647	The table list is cached for the number of seconds specified in the setting.