dbprocinfo

DB Library for C

DB Library for C

dbprocinfo

Returns information about a DBPROCESS connection.

Syntax

RETCODE dbprocinfo (
PDBPROCESS
pdbproc,
LPDBPROCINFO
pdbprocinfo );

Arguments

pdbproc

The DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000 process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.

pdbprocinfo

A pointer to a DBPROCINFO structure that DB-Library will fill with information about the specified connection.

The DBPROCINFO structure is defined as follows:

typedef struct
{
    DBINT  SizeOfStruct;
    BYTE   ServerType;
    USHORT ServerMajor;
    USHORT ServerMinor;
    USHORT ServerRevision;
    CHAR   ServerName[MAXSERVERNAME+1];
    CHAR   NetLibName[MAXNETLIBNAME+1];
    CHAR   NetLibConnStr[MAXNETLIBCONNSTR+1];
} DBPROCINFO, PTR LPDBPROCINFO;

The DBPROCINFO fields are described here.

Field Description
SizeOfStruct Before calling dbprocinfo, set this field equal to the value returned by the C sizeof function for the DBPROCINFO structure.
ServerType Is one of the following:

SERVTYPE_MICROSOFT if you are connected to a server running SQL Server.

SERVTYPE_UNKNOWN if you are connected to an unknown type of SQL Server.

ServerMajor Is the XX value in the XX.YY.ZZZ version number of the SQL Server you are connected to. For example, 6.
ServerMinor Is the YY value in the XX.YY.ZZZ version number of the SQL Server you are connected to. For example, 0.
ServerRevision Is the ZZZ value in the XX.YY.ZZZ version number of the SQL Server you are connected to. For example, 101.
ServerName Is the name of the SQL Server to which you are connected.
NetLibName Is the name of the Net-Library DLL used to connect to SQL Server.
NetLibConnStr Is the Net-Library connection string used to connect to SQL Server.

Returns

SUCCEED or FAIL.

Remarks

Before calling dbprocinfo, set the SizeOfStruct field equal to the value returned by the C sizeof function for the DBPROCINFO structure. The dbprocinfo function fills the supplied DBPROCINFO structure with information about the DBPROCESS connection.

See Also

dbopen