Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Error "Invalid Page Fault" When Connecting to Sybase


View products that this article applies to.

This article was previously published under Q163935

↑ Back to the top


Symptoms

The following error occurs after disconnecting from Sybase server and reconnecting:
"VFP caused an invalid page fault in module LIBCOMN.DLL"
This error occurs if the SQLCONNECT() function is used for connecting, and two or more connections have been made to Sybase 10 or 11. When any connection that was created before the last connection is terminated and then another connection is created, the error occurs. However, it only occurs with Sybase and the Sybase ODBC driver from Intersolv. Other database servers, such as SQL Server and Oracle, work correctly.

↑ Back to the top


Status

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0.

↑ Back to the top


More information

If an SQL connection is created with the SQLCONNECT() function, a numerical value is stored to the connection handle of the connection. If the value is greater than zero, then the connection is valid. The first connection usually has a value of one, and the second of two, and so forth. When one of the connections before the last connection is terminated, that termination leaves a lower number available for a future connection to use. Creating a new connection that uses one of these lower numbers causes the error.

Steps to Reproduce Behavior

Issuing the following code in a program (.PRG) file or from the Command window will cause the error to occur. After issuing each SQLCONNECT() function, you need to select the data source for Sybase and enter the correct UserId and password in the Logon dialog box. Note that x and y must return numbers greater than zero to ensure a valid connection:
      x = SQLCONNECT()
      ? x
      y = SQLCONNECT()
      ? y
      = SQLDISCONN(x)
      z = SQLCONNECT()
      ? z
				

↑ Back to the top


Keywords: KB163935, kbfix, kbbug, kb3rdparty

↑ Back to the top

Article Info
Article ID : 163935
Revision : 4
Created on : 3/2/2005
Published on : 3/2/2005
Exists online : False
Views : 488