sqlany_connect Function

Creates a connection to a SQL Anywhere database server using the specified connection object and connection string.

Syntax

sqlany_connect ( $conn, $str )

Parameters

Returns

Returns a scalar value that is 1 if the connection is established successfully or 0 when the connection fails. Use sqlany_error to retrieve the error code and message.

Example

# Create a connection
conn = api.sqlany_new_connection()

# Establish a connection
status = api.sqlany_connect( conn, "UID=DBA;PWD=sql" )
print "Connection status = #{status}\n"