Hi!
> Hi Kim,
>
> > In VC++ define _UNICODE and run this code :
> >
> > // Allocate the Environment Handle
> > sqlRetcode = SQLAllocHandle(SQL_HANDLE_ENV,
> > SQL_NULL_HANDLE,
> > &m_hEnv );
> >
>
> I think you have to set the environment attribute, whether
> you want to do ODBC-Ver 2 or 3. Furthermore it is a good idea
> to check the return code after the allocation calls.
Thanks, I set the environment attribute.
>
> > // Allocate the Connection handle
> > sqlRetcode = SQLAllocHandle(SQL_HANDLE_DBC,
> > m_hEnv,
> > &m_hDbc );
> >
> > sqlRetcode = SQLConnect( m_hDbc,
> > _T("dsn_name"),
> > SQL_NTS,
> > _T("uid"),
> > SQL_NTS,
> > _T("pwd"),
> > SQL_NTS);
> >
> > if (sqlRetcode != SQL_SUCCESS) {
> > GetDBError(SQL_HANDLE_DBC, m_hDbc);
> > return FALSE;
> > }
> [snip]
> > And I want to know that what files include and how setting library.
>
> sqlucode.h. The ODBC driver contains both, ASCII and Unicode functions.
> In case of Windows, always the Unicode API is used. If the application
> is non Unicode, the driver manager maps the calls (see ODBC reference).
I include sql.h, sqlext.h and sqlucode.h. And append sqlod32.lib,
sqlodext.lib, and odbc32.lib in Project Settings->Link->Object/library
modules.
It work well not define UNICODE. But define UNICODE, call SQLConnectW and it
return -2
Anything wrong?
>
> Regards Thomas
>
>
> ----------------------------------------------
> Dr. Thomas Kotter
> SAP DB, SAP Labs Berlin
>
>
> SAP DB is open source. Get it! www.sapdb.org
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general