ConnectionOpen/ConnectionOpenW

Opens an IPC-dependent connection.

Syntax

RETCODE ConnectionOpen (
   void       *ConnectionObject,
   char       *networkname,
   LONG       *errno );

Parameters

  • ConnectionObject
    Pointer to a IPC-dependent structure.
  • networkname
    The name of the given instance of SQL Server to which you are trying to connect.
  • errno
    Pointer to a variable of short integer type. If defined, a positive value is an operating system error or an IPC error, a -1 is an unknown error.

Return values

SUCCEED or FAIL.

Remarks

  • ConnectionOpen must be called after ConnectionObjectSize.
  • ConnectionOpen fills in the IPC-dependent Connection object, which is a structure containing whatever information is necessary for a particular IPC to open and maintain a connection.
  • ConnectionOpen does the IPC-dependent work of finding and connecting to networkname. This may require looking in the Windows Registry for connection-specific information. See Appendix A: Registry Entries for protocol specific connection information.
  • errno will be filled in if an error occurs. Otherwise, its value is undefined.
  • ConnectionOpenW is the Unicode wide version of ConnectionOpen.

See Also

ConnectionObjectSize | ConnectionRead | ConnectionWrite | ConnectionTransact | ConnectionClose | ConnectionWrite

Applies To: Connection Object (Net-Library)