Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for fix #287 #288

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Samples/Win7Samples/dataaccess/oledb/rowsetviewer/crowset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ HRESULT CDataAccess::GetColumnData(const DBBINDING* pBinding, void* pData, DBSTA
//(ie: DBTYPE_WSTR = "130". So we need to convert the string to an int, then to
//the actual assoicated mapped type name (for ease of viewing without having to
//have the header handy when viewing schemas).
DBTYPE wSchemaType;
if(ConvertToLONG(pwszValue, (LONG*)&wSchemaType, 0/*Min*/, LONG_MAX, 0/*Base*/))
LONG lSchemaType; /* it will be set with DBTYPE (USHORT) value */
if(ConvertToLONG(pwszValue, &lSchemaType, 0/*Min*/, USHRT_MAX, 0/*Base*/))
{
//NOTE: on failure we have no choice to leave the column as the original
//returned integer.
StringCopy(pwszValue, GetDBTypeName(wSchemaType), ulMaxSize);
StringCopy(pwszValue, GetDBTypeName((DBTYPE)lSchemaType), ulMaxSize);
}
}
}
Expand Down