Microsoft KB Archive/235224

= BUG: Compiling ANSI Build of Dao36x.dll Generates Error =

Article ID: 235224

Article Last Modified on 4/29/2007

-

APPLIES TO


 * The DAO SDK, when used with:
 * Microsoft Visual Studio 6.0 Service Pack 3

-



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;



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
Steps to Reproduce:

 Install Visual Studio 6.0 Service Pack 3, which is downloadable from the following Web site:

http://msdn2.microsoft.com/en-us/vstudio/aa718359.aspx/

 Open the DAO SDK Workspace (Dbdao.dsw) included with Visual Studio 6.0 SP3. Distribute the DAO SDK header files into your projects include path (make sure no other version of Dbdao.h is in include path). Choose Win 32 Debug or Win 32 Release configuration. Rebuild all.</li></ol>

Additional query words: kbDatabase kbdbDao kbVCdb

Keywords: kbbug kbdatabase KB235224

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.