Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere for Ruby » SQL Anywhere Ruby API



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

sqlany_connect ( $conn, $str )
  • $conn   The connection object created by sqlany_new_connection.

  • $str   A SQL Anywhere connection string.


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.

See also
# 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"