SE_connection_create

Connects the application to the ArcSDE server

Usage syntax

LONG SE_connection_create (const CHAR *server,const CHAR *instance,const CHAR *database,const CHAR *username,const CHAR *password,SE_ERROR *error,SE_CONNECTION *connection);

Parameters
server Host name of the server running ArcSDE
instance The ArcSDE instance name or direct connect driver
database The database or data source name; not applicable on Oracle
username DBMS user's login name
password DBMS user's login password
error Any error code is returned here
connection Returned connection handle
Description

This function establishes a connection between a client application and the ArcSDE server. You must establish a connection before performing any other operation. An ArcSDE server task, gsrvr, is created for each successful call to the SE_connection_create function. If you pass a database or data source name to a DBMS that does not support them, SE_DBMS_DOES_NOT_SUPPORT is returned. However, if your DBMS supports named databases or data sources and you do not specify one, the connection will connect to the default database or data source.

You can use operating system environment variables to define the server, instance, database, user name, and password. While supported, using the password variable is not recommended because it can compromise your security. Additionally, if you are connecting to different servers and databases, do not set SDESERVER, SDEINSTANCE, or SDEDATABASE. Similarly, if you are using operating system (OS) authenticated users, do not set the SDEUSER varialbe.

For any argument for which the variable is set, pass NULL with SE_connection_create. Possible variables are as follows:

SDESERVER—the name of the ArcSDE server

SDEINSTANCE—the name of the ArcSDE instance or direct connect driver

SDEDATABASE—the name of the ArcSDE database (if required by the underlying DBMS)

SDEUSER—the user name

SDEPASSWORD—the user's password

If an OS- or DBMS-level error occurs, the SE_ERROR structure will contain the extended error code and two error message strings that describe the nature of the error.

typedef struct {

  LONG sde_error;                       /* ArcSDE error code */

  LONG ext_error;                       /* DBMS or OS errno code */

  CHAR err_msg1[SE_MAX_MESSAGE_LENGTH]; /* DBMS or SE_ERROR_get_string msg */

  CHAR err_msg2[SE_MAX_MESSAGE_LENGTH]; /* Second DBMS error, if applicable */

} SE_ERROR;

Returns

SE_SUCCESS
SE_FAILURE

SE_DBMS_DOES_NOT_SUPPORT
SE_IOMGR_NOT_AVAILABLE
SE_INVALID_DATABASE

SE_INVALID_POINTER
SE_INVALID_SERVER
SE_INVALID_USER
SE_LOGIN_NOT_ALLOWED

SE_NET_FAILURE
SE_NET_TIMEOUT

SE_NO_ACCESS
SE_SDE_NOT_STARTED
SE_SERVICE_NOT_FOUND
SE_SQL_SERVER_CLIENT_SOFTWARE_TOO_OLD
SE_TASKS_EXCEEDED
SE_UNSUPPORTED_DATABASE_VERSION

Notes