Re: Problem with ODBC class
От | Clemens Ladisch |
---|---|
Тема | Re: Problem with ODBC class |
Дата | |
Msg-id | 5e55ec85-c319-0196-dad9-8ecf655eb118@ladisch.de обсуждение исходный текст |
Ответ на | Problem with ODBC class (Igor Korot <ikorot01@gmail.com>) |
Список | pgsql-odbc |
Igor Korot wrote: > memset( qry, '\0', query.size() + 2 ); > memset( table_name, '\0', tableName.length() + 2 ); > memset( schema_name, '\0', schemaName.length() + 2 ); memset() expects a length in bytes. > retcode = SQLBindParameter( stmt, 1, > SQL_PARAM_INPUT, SQL_C_WCHAR, SQL_WCHAR, schemaName.length(), 0, > schema_name, 0, &cbSchemaName ); Are you sure that a BufferLength (9th parameter) of zero is allowed? The SQL_DESC_OCTET_LENGTH documentation says: | The length, in bytes, of a character string or binary data type. For | fixed-length character or binary types, this is the actual length in | bytes. For variable-length character or binary types, this is the | maximum length in bytes. > SQLWCHAR *owner = NULL; > ... > retcode = SQLBindCol( stmt, 1, SQL_C_WCHAR, &owner, columnSizePtr, &cbTableOwner ); You are giving the address of the pointer, so the pointer itself gets overwritten. Regards, Clemens
В списке pgsql-odbc по дате отправления: