Re: mySQL and SQLDriverConnect
Igor Korot <[email protected]>
| Newsgroups | gmane.comp.db.unixodbc.devel |
|---|---|
| Message-ID | <6516757.1213975011548.JavaMail.root@mswamui-swiss.atl.sa.earthlink.net> |
Nick, -----Original Message----- >From: Nick Gorham <[email protected]> >Sent: Jun 20, 2008 12:07 AM >To: Igor Korot <[email protected]> >Cc: Development issues and topics for unixODBC <[email protected]> >Subject: Re: [unixODBC-dev] mySQL and SQLDriverConnect > >Igor Korot wrote: > >>Hi, >> >>-----Original Message----- >> >> >>>From: Nick Gorham <[email protected]> >>>Sent: Jun 18, 2008 11:40 PM >>>To: Igor Korot <[email protected]> >>>Cc: Development issues and topics for unixODBC <[email protected]> >>>Subject: Re: [unixODBC-dev] mySQL and SQLDriverConnect >>> >>>Igor Korot wrote: >>> >>> >>> >>>>Hi, Nick, >>>> >>>> >>>>1. >>>>retcode = SQLDriverConnect( m_hdbc, parentWnd, (SQLTCHAR FAR *)"DSN=test;", (SWORD) connectStr.length(), (SQLTCHAR FAR *) outConnectStr, WXSIZEOF( outConnectStr ), &outConnectStrLen, SQL_DRIVER_NOPROMPT ); >>>> >>>>2. >>>>retcode = SQLDriverConnect( m_hdbc, parentWnd, (SQLTCHAR FAR *)"Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=test;User=root;Password=wasqra;Option=3;", (SWORD) connectStr.length(), (SQLTCHAR FAR *) outConnectStr, WXSIZEOF( outConnectStr ), &outConnectStrLen, SQL_DRIVER_NOPROMPT ); >>>> >>>>Both calls fails, returning -1 in the "retcode". >>>> >>>>Again connecting using isql works, which means that the driver works and it's something wrong with the SQLDriverConnect logic. >>>>Maybe in the first case it's looking for the global (system) DSN only, and does not fallback to the user one? >>>>And for the second case I don't even know. >>>> >>>>Can you or someone else confirm? >>>> >>>>Thank you. >>>> >>>> >>>> >>>> >>>What error is returned from SQLDriverConnect, I think it might be worth >>>asking the question of the driver writers, as I think thats where the >>>problem might lie. >>> >>> >> >>Before I go ask this on mySQL site, I want to confirm one thing: >> >>My application compiled with the UNICODE support on. >>But I explicitly call non-UNICODE ODBC API function, and the driver I installed is not UNICODE aware. >> >>What's going to happen in this case? Will the app call non-UNICODE function from DM? And if not, how DM >>and the driver will communicate? >> >>Thank you. >> >> >By the way, when you say you explicitly call the non unicode function, >do you mean you call SQLDriverConnectA, becaue with UNICODE defined >SQLDriverConnect becomes SQLDreiverConnectW (as it does in windows) retcode = SQLDriverConnect( m_hdbc, parentWnd, (SQLTCHAR FAR *)"DSN=test;", ...); ^^^^^^^^^^^^^^ I am doing casting of the parameters. In UNICODE version, this would become (SQLWCHAR FAR *). So, unless the linker is not smart, he should look at the proper signature of the function. Or maybe I'm dumb? Thank you. > >-- >Nick _______________________________________________ unixODBC-dev mailing list [email protected] http://mail.easysoft.com/mailman/listinfo/unixodbc-dev