How to Trouble-Shoot Sybase Server Connections in FoxPro

Last reviewed: April 30, 1996
Article ID: Q128557
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6, 2.6a

SUMMARY

On occasion, you may have difficulty in connecting to a Sybase server. The information in this article should help you troubleshoot connection problems when attaching to a Sybase server.

MORE INFORMATION

The Sybase Server database product is one of several back-end server data sources that FoxPro can connect to via ODBC. Microsoft does not include a driver specific to Sybase in the Connectivity Kit. Sybase drivers can be obtained from either Sybase or 3rd party ODBC driver vendors. The Microsoft SQL Server ODBC driver included in the Connectivity Kit was certified for connecting to 4.9.2 or earlier Sybase SQL Servers. This driver will not connect to Sybase System/10 servers, however, and the newer ODBC SQL Server drivers from Microsoft (starting with version 2.00.1912) are not certified to connect to any Sybase SQL Server versions.

If you attempt to connect to a pre-System/10 Sybase server with the older Microsoft drivers, you may get a -2 error return code, which indicates an environment-level error. Using DEBTOR() to find the specific error message may yield something like this:

   3-1 ODBC error 08001 (-1) [microsoft ODBC sql server driver] unable
   to connect to data source

Or you may get this version of the message:

   IM002 - Datasource not found - No default driver specified.

The most common error that occurs when connecting to a Sybase server is caused by the fact that the INSTCAT.SQL file has not been run. INSTCAT.SQL is a configuration file distributed with the FoxPro ODBC installation disk. This program must be run against versions of SQL Server or Sybase that are earlier than 4.2a.

NOTE: If INSTCAT.SQL is transferred from one location to another, it should not be sent using FTP with binary mode. It must be transported using text mode. When INSTCAT is run, if it comes back within a few seconds, INSTCAT has not run successfully; however, there will be no indication of this. You still will not be able to connect. Instead, when INSTCAT runs, it will take approximately one to two minutes. When it has completed, you should attempt to connect again. INSTCAT.SQL will NOT run successfully if the master database is full. If this is the case, the master database will need to be rebuilt to provide the necessary room for INSTCAT.

If these steps do not solve the problem, try the following:

  • Does the utility "Ping" see the server? If not, FoxPro will not connect. Ping is a third-party utility provided by Sybase and is warranted by Sybase, not Microsoft. Note that although Ping may be able to see the server, it does not go through ODBC to do so. It is a useful utility to establish that the network connections are working correctly.
  • Is the ODBC driver configured properly? The ODBC driver is typically configured from the Windows Control Panel. You should see either a Sybase or, if using the Microsoft SQL Server driver, the SQL Server driver listed as one of the data source drivers.
  • When issuing the DBCONNECT(), are you referencing the right name in the data_source portion of the DBCONNECT() string? In the ODBC SQL Server Setup, the name that is entered in the Data Source Name field is what will be used in the DBCONNECT() string.
  • Have you entered the correct server name? The server name is the name that identifies SQL Server on your network. If you are running on top of TCP/IP, you should enter an alias and you must also add values in the Network Library and Network Address text boxes.
  • Have you specified the correct network address? The network address specifies the location of the SQL Server system from which the driver will retrieve data. Under TCP/IP, this will take the form IP-Address.Socket-Address (e.g. 1.1.8.1.166.2025). For Microsoft SQL Server, this should be left to the value of (default).
  • Do you have the right network library? This is the name of the SQL Server Net-library DLL that the SQL Server driver uses to communicate with the network software. If this value is left to (default), the server driver will use the library for the default network specified in the SQL Server Client Configuration Utility.
  • Do you have a current version of the Sybase DLL Network Libraries?
  • Have you tried connecting using Excel and ODBC? Another package and ODBC?
  • Have you contacted Sybase to ensure that you have the right drivers installed on your local machine?
  • Have the stored procedures for Sybase been installed?
  • Are you putting a "" in the fourth parameter of the DBCONNECT string and not a " " (quotation mark, space, quotation mark)? SQL Server and Sybase do not use the fourth parameter.
  • Is the Network Support Library for SQL Server located in a path where it can be found?

If you are using CKSAMPLE.APP to log on and it isn't working or it errors out, then try to log on directly by setting the library to FPSQL and issuing a manual DBCONNECT. For more information on how to do this, please see page 5 of the FoxPro Connectivity Kit manual.

This information should resolve the majority of problems when connecting to a Sybase server. If none of these solutions work, please contact Microsoft Product Support for further assistance.


Additional reference words: FoxWin 2.60a ODBC SYBASE SQL SERVER TSHOOT
KBCategory: kbinterop
KBSubcategory: FxinteropOdbc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.