[unixODBC-dev] (no subject)

Igor Korot ikorot at earthlink.net
Fri Aug 15 21:21:02 BST 2008


Nick,

-----Original Message-----
>From: Nick Gorham <nick at lurcher.org>
>Sent: Aug 15, 2008 12:10 AM
>To: Igor Korot <ikorot at earthlink.net>, Development issues and topics for unixODBC <unixodbc-dev at easysoft.com>
>Subject: Re: [unixODBC-dev] (no subject)
>
>Igor Korot wrote:
>
>>Hi, (Nick),
>>What is the proper way to call SQLConfigDataSource()?
>>
>>My code (pseudo-code):
>>
>>SQLWCHAR *dsn = "mySQL"
>>SQLWCHAR param[254];
>>ret = SQLConfigDataSource( HWND, ODBC_ADD_DSN, dsn, param );
>>if( ret != SQL_SUCCESS )
>>{
>>// show error message
>>}
>>
>>The code executes fine, according to the log file: function gives SQL_SUCCESS 2 times from SQLDataSourceW.c
>>
>>But then the program crashes.
>>
>>Doing "bt" in gdb shows that the crash occuring in the libodbcinst.so.1.
>>
>>Any thoughts?
>>  
>>
>Seems ok, can you provide any code I can run that causes the problem?
>
>Do you set param to be empty first ?

That's pretty much it.
The only reason I said it's a pseudo-code, is because I am using wxWidgets library
for development. They using UTF8 in SVN TRUNK.
So, basically, I am converting initial string to be UTF16 (SQLWCHAR *dsn).

Variable "param" is declared only, it is not initialized.
Does it has to be like this:

SQLWCHAR param[254] = "";

>
>-- 
>Nick

Thank you.



More information about the unixODBC-dev mailing list