-----Original Message-----
From: Schroeder, Alexander 
Sent: Friday, March 07, 2003 4:37 PM
To: '[EMAIL PROTECTED]'; sapdb-general
Subject: RE: ODBC under Windows 2000




> -----Original Message-----
> From: Ralf Schneider [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 07, 2003 4:22 PM
> To: sapdb-general
> Subject: ODBC under Windows 2000
> 
> 
> I'm currently porting my application from Linux to Windows 2000. The 
> application uses ODBC to access SAPDB. I have written a C++ 
> class that 
> encapsulates the ODBC calls.
> 
> Under Linux everything works fine. But now, on windows I get 
> strange compiler 
> errors from Visual C++ 6.0. When I call SQLDriverConnect with 
> this call
> 
> rc = SQLDriverConnect (mHdbc, (HWND)NULL, 
> (SQLCHAR*)connectString.ascii(),              
>                               SQL_NTS, (SQLCHAR*)outString, 
> sizeof(outString), &outLen, 
>                                       SQL_DRIVER_NOPROMPT);
> 
> I get the following error message:
> 
> .\dbconnection.cpp(76) : error C2664: 'SQLDriverConnectW' : 
> Konvertierung des 
> Parameters 3 von 'unsigned char *' in 'unsigned short *' 
> nicht moeglich
> Die Typen, auf die verwiesen wird, sind nicht verwandt; die 
> Konvertierung 
> erfordert einen reinterpret_cast-Operator oder eine 
> Typumwandlung im C- oder 
> Funktionsformat

Both the reference to SQLDriverConnectW and the error message show, that 
the preprocessor define UNICODE is defined at the time the header was 
included. This redefines the function ...

Regards
Alexander Schr�der
SAP Labs Berlin



> 
> Why does the compiler tells something about SQLDriverConnectW 
> while I use 
> SQLDriverConnect without W? I assume SQLDriverConnectW uses 
> SQLWCHAR instead 
> of SQLCHAR, right? And SQLWCHAR is mapped to short, right? But why is 
> SQLDriverConnectW called and not SQLDriverConnect?
> 
> Any ideas?
> 
> Ralf.
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to