Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows7 64bit ODBC driver (# 15.7.0.80.1008) not returning image, varbinary data

140 views
Skip to first unread message

pyuser

unread,
Feb 22, 2012, 4:55:46 AM2/22/12
to
Hi All,

Im facing a problem in fetching image, varbinary data. Details given
below.

When I try to fetch image, varbinary data from a table created in
Sybase ASE 15.7 (Developer edition) on Windows 7 64bit using ODBC
driver (version:15.7.0.80, ODBC version:3.51), I get NULL data in data
buffer.

Data can be seen in "Interactive SQL" window opened from "Sybase
Central" tool.

My ODBC (C++) application (64bit) on Windows 7 has following sequence
of actions to fetch this image data:
// prepare query:
wchar_t *query = _T("select * from mytable NOLOCK;");
SQLRETURN ret = 0;
ret = SQLPrepare(stmt, query, SQL_NTS);
if (!SQL_SUCCEEDED(ret))
{
TRACE("SybAse:SQLprepare failed.");
DbException::sqlErrorInfo(SQL_HANDLE_STMT, stmt);
throw DbException(std::string(""));
}
// bind to column:
SQLBindCol(stmtHdl, columnNumber, SQL_C_BINARY,
m_colValue[0], m_len, &m_LenInd[0]);
// Execute query:
ret = SQLExecute(stmt);
// fetch rows
if (SQL_SUCCESS == ret || SQL_SUCCESS_WITH_INFO == ret)
{
do {
ret = SQLFetchScroll(m_stmt, SQL_FETCH_NEXT, 0);
// handle data per row here...
} while(SQL_SUCCEEDED(ret));
}

Can you please help me know if there are any options that I need to
set when doing select of image, varbinary columns from ODBC?

Thanks in advance for the help.
0 new messages