Up Prev Next
From: "Walter Kowash" <walter dot kowsh at prudential dot com>
Subject: Re: dbprocinfo method in MS SQL Server 7.0 DBLIB library
Date: Dec 6 2000 4:01PM
Yes it is MS SQL Server specific please see below:
< BEGIN >
Returns information about a DBPROCESS connection.
RETCODE dbprocinfo (
LPDBPROCINFO pdbprocinfo );
The DBPROCESS structure that is the handle for a particular
workstation/Microsoft® SQL Server? process. It contains all the information that
DB-Library uses to manage communications and data between the workstation and
A pointer to a DBPROCINFO structure that DB-Library will fill with information
about the specified connection.
The DBPROCINFO structure is defined as follows:
} DBPROCINFO, PTR LPDBPROCINFO;
The DBPROCINFO fields are described here.
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 you are connected to
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
SUCCEED or FAIL.
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
(c) 1988-98 Microsoft Corporation. All Rights Reserved.
My problem has been instantiating the pointer reference to the structure.
Once my code his the ptr->SizeOfStruct or any other structure member reference
it goes south with a run time error.
Here is my code snipet:
DBPROCINFO test; // allocate a DBPROCINFO
structure to receive informataion from dbprocinfo method
LPDBPROCINFO dbinfo; // allocate a pointer to the
DBINT db_struct_size; // storage area of size of
dbinfo->SizeOfStruct = sizeof(test); // Point of failure.
printf("The structure's size is: %d\n", sizeof(DBPROCINFO));
Any help in explaining the error of my ways would be greatly appreciated.