Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

(Visual C++) SQLBindCol: pointer mismatch

marth0935marth0935 Member Posts: 3
Hello. I have a bit of a problem in getting information from a result set from Access. Here's the deal:

ObjectId, the field that I want to retrieve, is of type number (integer). The following SQL statement was used in order to retrieve it:

SELECT * FROM O_Table WHERE ObjectId = 1;

In getting the result set, I used SQLBindCol and then SQLFetch. This is how I declared ObjectId as a structure (together with the rest of the fields).

[code]
struct
{
SQLSMALLINT ObjectId;
...
} row;
[/code]

In declaring the SQLBindCol function:

[code]
sr = SQLBindCol(hstmt, 1, SQL_C_SSHORT, row.ObjectId, sizeof(row.ObjectId), &row.IdLength);
[/code]

The error returned the following during build time:
warning C4022: 'SQLBindCol' : pointer mismatch for actual parameter 4

Apparently, even though it is a warning, when I try to run it, the program ends with a fatal error and is required to terminate.

Thanks for anyone who can shed some light in this problem...
Sign In or Register to comment.