Microsoft KB Archive/100801
Troubleshooting Connectivity Kit Errors w/ FoxPro for Win
2.50 2.50a | 2.50 2.50a
WINDOWS | MS-DOS
kbtool kbtshoot kbprg The information in this article applies to:
The FoxPro Connectivity Kit can be used with Microsoft FoxPro version 2.5 for MS-DOS and Windows.
Below are some basic steps to troubleshoot Connectivity Kit errors in FoxPro for Windows.
NOTE: The DBConnect() function will make a connection to the default database. To connect to another database, you must issue the DBExec() function and USE the other dDatabase.
1. Delete ODBC.DLL and reinstall by running the Setup program on Disk
2 of the Connectivity Kit. NOTE: You may want to restart Windows after completing this step.
2. Delete and reinstall the source driver (for example, SQL
Server or Oracle). NOTE: If you are using Microsoft SQL Server earlier than the version of the Microsoft SQL Server ODBC Driver, your SQL Server system administrator may need to upgrade the catalog system stored procedures on the server. Please refer to Microsoft Knowledge Base Article Q137635 for more information on determining if the upgrade is needed. The INSTCAT.SQL file for the Microsoft ODBC driver that shipped with the FoxPro Connectivity Kit is located on the ODBC Setup disk that ships with the kit.
3. Create a test driver that contains valid information for a DBMS
connection. Please contact the system administrator to obtain a valid server name, user ID, password, and any necessary setup strings.
4. Make note of the complete error message. This is important for
accurate troubleshooting of the error. The error message format is [Vendor][ODBC-Component][Data Source] "<Error Message>" where: - Vendor provides the name of the ODBC driver's vendor. - ODBC-Component provides name of the ODBC component where the error was generated. - Data Source provides name of the data source. This may not always be present in the error message. If this is specified in the error, the connection has been made to the data source, and an error has occurred after that connection has been established. - Error Message provides the specific error that was generated. Please include as many of the above components of the error message as are available. To obtain the error message: a. Obtain the return value of the Connectivity Kit function: handle = DBCONNECT("test","myid","mypasswd","") ? handle b. Initiate two variables, one numeric and one character: errmsg = "" errno = 0 c. Use the DBError() function to find the error: If the result is -1: errtype = DBError(handle,@errmsg,@errno) If the result is -2: errtype = DBError(0,@errmsg,@errno) IMPORTANT: The variables passed to the DBError() function must be passed by reference. The following program is an example of how to include an error-checking routine: errmsg = "" errno = 0 connect = "test" id = "<user id>" password = "<user password>" conn_str = "<connection string>" handle = DBConnect(connect,id,password,conn_str) DO CASE CASE handle = -1 = DBError(handle,@errmsg,@errno) ?errmsg CASE handle = -2 = DBError(0,@errmsg,@errno) ?errmsg ENDCASE
Additional reference words: FoxWin FoxDos CK 2.50 2.50a ODBC connectivity tshoot KBCategory: kbtool kbtshoot kbprg KBSubcategory: FxtoolCk
Keywords : FxtoolCk Version : 2.50 2.50a | 2.50 2.50a Platform : MS-DOS WINDOWS
Last Reviewed: April 30, 1996