Returns a pointer to the name of the database column from which the specified result column was derived.
LPCSTR dbcolsource (
INT colnum );
Is 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.
Is the number of the result column. The first column is number 1.
A pointer to a null-terminated column name. This pointer is NULL if the column number is out of range or if the column is the result of a Transact-SQL expression, such as MAX(colname).
The dbcolsource function is one of the DB-Library browse-mode functions. This function gives an application the information it needs to update a database column, based on an ad hoc query. SELECT statements can optionally specify header names for result columns. For example:
SELECT author = au_lname FROM authors FOR BROWSE
When updating a table, you must use the database column name, not the header name (in this example, au_lname, not author). You can use the dbcolsource function if FOR BROWSE is issued on a view and to get the underlying database column name. For example:
This call returns a pointer to the string au_lname.
The dbcolsource function is useful for ad hoc queries. If the query has been hardcoded into the program, this function is unnecessary.
The dbcolsource function can be called any time after dbresults returns SUCCEED.