BUG: Compiling ANSI Build of Dao36x.dll Generates Error (235224)
The information in this article applies to:
- The DAO SDK, when used with:
- Microsoft Visual Studio 6.0 SP3
This article was previously published under Q235224 SYMPTOMS
Trying to build a non-Unicode configuration of Dao36x.dll using the Dao3.6 SDK provided with Visual Studio 6.0 Service Pack 3 causes the following compiler error:
error c2440: '=' : cannot convert from 'const unsigned short *' to 'const char '*'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast, or function-style cast.
CAUSE
This error references Dbdao.cpp, line 2353:
pColumnBind[iBinding0.columnID.lpstr = prb[iBinding].pstr;
The member variable LPSTR is defined in Daogetrw.h, line 72, as type LPCSTR; whereas, pstr is defined in Dbdao.h, line 85, as type LPCWSTR.
The compiler can't convert type LPCWSTR to type LPCSTR as attempted on line 2353 of Dbdao.cpp, causing the above error to be generated. RESOLUTION
To prevent the error, you need to make the following modification to line 91 in Dbdao.h:
Replace the following
LPCWSTR pstr;
with the following:
LPCTSTR pstr;
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/10/2006 |
---|
Keywords: | kbbug kbDatabase KB235224 |
---|
|