This is noob, I know, but I haven't touched basic C in years...
I'm trying to call into the ODBC call "SQLGetConnectAttr", as documented here:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms710297(v=vs.85).aspx
My code is...
The code runs without errors, but I'm getting gooblygook output. I suspect I'm declaring or passing the buffer incorrectly? That I should or should not have a * and/or & somewhere?
I'm trying to call into the ODBC call "SQLGetConnectAttr", as documented here:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms710297(v=vs.85).aspx
My code is...
Code:
SQLCHAR szName[SQL_MAXIMUM_CATALOG_NAME_LENGTH];
SQLINTEGER iLen;
SQLINTEGER nResult;
nResult = SQLGetConnectAttr(&hdbc, SQL_ATTR_CURRENT_CATALOG, &szName, SQL_MAXIMUM_CATALOG_NAME_LENGTH, &iLen);
if (nResult != SQL_SUCCESS)
{
// do something!
}
return [NSString stringWithCString:(char *)&szName encoding:NSASCIIStringEncoding];
Last edited by a moderator: