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