Re: mySQL and SQLDriverConnect
Nick Gorham <[email protected]>
| Newsgroups | gmane.comp.db.unixodbc.devel |
|---|---|
| Message-ID | <[email protected]> |
Ok,
I just tried this code:
> #define UNICODE
>
> #include <stdio.h>
> #include <sql.h>
> #include <sqlext.h>
> #include <sqlucode.h>
>
> main()
> {
> SQLWCHAR dsn[] = { 'D','S','N','=','t','e','s','t',';', 0 };
> SQLHANDLE env, dbc;
> SQLRETURN ret;
>
> ret = SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env );
> ret = SQLSetEnvAttr( env, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) 3, 0 );
> ret = SQLAllocHandle( SQL_HANDLE_DBC, env, &dbc );
>
> ret = SQLDriverConnect( dbc, NULL, dsn, SQL_NTS,
> NULL, 0, NULL, SQL_DRIVER_NOPROMPT );
> }
And running it gives me this in the trace file
> [ODBC][1620][1214210235.511832][SQLDriverConnectW.c][283]
> Entry:
> Connection = 0x8049e20
> Window Hdl = (nil)
> Str In = [DSN=test;][length = 9 (SQL_NTS)]
> Str Out = (nil)
> Str Out Max = 0
> Str Out Ptr = (nil)
> Completion = 0
> UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE'
>
> [ODBC][1620][1214210238.703964][SQLDriverConnectW.c][839]
> Exit:[SQL_SUCCESS_WITH_INFO]
> Connection Out [[NULL]]
Thats on Linux x86, if you are on a big endian platform there may be
endian issues, but as you can see the code and log matches what I would
expect.
--
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mail.easysoft.com/mailman/listinfo/unixodbc-dev