isc_service_attach()
Go Up to API Function Reference
Attaches to the InterBase Services Manager facility. You must do this before using the InterBase services functions to request execution of tasks or query information from the Services Manager.
Syntax
ISC_STATUS isc_service_attach(
ISC_STATUS *status_vector,
unsigned short service_length,
char *service,
isc_svc_handle *svc_handle,
unsigned short spb_length,
char *spb);
<Parameter> |
Type | Description |
---|---|---|
<status_vector> |
|
Pointer to the error status vector |
<service_length> |
unsigned short |
Length in characters of the service name; a value of zero means that the service name is a null-terminated string. |
<service> |
char * |
String containing the name of the service to which the client requests an attachment. |
<svc_handle> |
|
Pointer to a long value containing the handle of the service structure. |
<spb_length> |
unsigned short |
Length in bytes of the services parameter buffer |
<spb> |
char * |
Pointer to a services parameter buffer |
Description
You can use this function to attach to the Services Manager on a given InterBase server. The InterBase service must be running on that host before you can attach to the Services Manager.
You must specify the hostname and the literal string service_mgr
in the service
argument. For example, jupiter:service_mgr
is the string you use to connect to the Services Manager on host jupiter
using TCP/IP as the network protocol.
You must specify a user ID and the corresponding password as part of the options in the service parameter buffer. The Services Manager uses this user ID when performing service tasks you request.
There are components in the InterBase Express™ package for Delphi and C++Builder that provide a visual interface to the Services Manager. See the Developer's Guide.
Example
See Attaching to the Services Manager with isc_service_attach( ) for an example using C/C++ code.
Return value
isc_service_attach()
returns the second element of the status vector. Zero indicates success. A nonzero value indicates an error. For InterBase errors, the first element of the status vector is set to 1, and the second element is set to an InterBase error code.
To check for an InterBase error, examine the first two elements of the status vector directly. For more information about examining the status vector, see Handling Error Conditions.