Home > Archive > MS SQL Server > December 2006 > help~What is restricted data type attribute violation bring?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author help~What is restricted data type attribute violation bring?
Jan

2006-12-06, 7:12 pm

I'd get a data of int type from connected SQL DB by SQLGetData function.
The code is following:

SQLRETURN ret = 0;
ULONG lRow = 0;
ULONG* pPtr = NULL;
LONG csize = 0;
SHORT sType = 0;
ULONG pColLenPtr = NULL;

/*
Do something for args
lRow = 0;
sType = 4; // SQL_C_INTEGER
pPtr point to an available buffer
csize = 4; // 4 Bytes
pColLenPtr point to an avaliable buffer
*/

ret = SQLGetData(m_hSTMT, i + 1,
(SQLSMALLINT)sType,
(SQLPOINTER)pPtr,
(SQLINTEGER)csize,
(SQLINTEGER*)pColLen
Ptr);

But, Occur an error here.
ret == -1; // SQL_ERROR
SQLState == 07006; // Restricted data type attribute
NativeError == 0;
cbErrorMsg == 55;
I don't know this why? Who may be tell me, please? Thanks.






Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com