Re: (no subject)

Igor Korot <[email protected]>
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <21895526.1218831662501.JavaMail.root@mswamui-andean.atl.sa.earthlink.net>
Nick,

-----Original Message-----
>From: Nick Gorham <[email protected]>
>Sent: Aug 15, 2008 12:10 AM
>To: Igor Korot <[email protected]>, Development issues and topics for unixODBC <[email protected]>
>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.
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mail.easysoft.com/mailman/listinfo/unixodbc-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.