7 messages in com.mysql.lists.bugsRe: ODBC's SQLColumns with column nam...
FromSent OnAttachments
Sergey Tulyakov17 Feb 2003 12:22 
Venu18 Feb 2003 12:54 
Sergey Tulyakov18 Feb 2003 20:51 
Venu19 Feb 2003 10:37 
Sergey Tulyakov19 Feb 2003 11:56 
Venu20 Feb 2003 21:40 
Sergey Tulyakov21 Feb 2003 11:22 
Subject:Re: ODBC's SQLColumns with column name specified
From:Venu (ve@mysql.com)
Date:02/18/2003 12:54:00 PM
List:com.mysql.lists.bugs

On Mon, 2003-02-17 at 12:22, Sergey Tulyakov wrote:

Hello everybody!

Hi !!

I have a problem with ODBC call to SQLColumns(). The problem is that result set does not contain any data.

How-To-Repeat: Create table 'test_table' with column 'test_column' in the database 'test', and user 'test' with password 'test'. Setup DSN 'test_mysql'.

ok..

Execute following function(first SQLFetch will return SQL_NO_DATA):

The reason is, you are passing wrong input values to SQLColumns.

ret=SQLColumns(hstmt, NULL, 0, (SQLCHAR*)_T("test"), SQL_NTS, (SQLCHAR*)"test_table", SQL_NTS, (SQLCHAR*)"test_column", SQL_NTS);

Why are you supplying _T("test") as the schema name ? If you want to pass catalog name as "test", then pass that with the argument 2 instead of argument 3 i.e. it should be:

SQLColumns(hstmt, "test", SQL_NTS, /* catalog name */ SQL_NULL_HANDLE, 0, /* schema name */ "test_table", SQL_NTS, /* table name */ "test_column", SQL_NTS); /* column name */

Thanks

Join MySQL Users Conference and Expo: http://www.mysql.com/events/uc2003/