Closed dweberlj closed 2 months ago
I am not sure if it need any specific configurations. Microsoft's ODBC documentation does not specify anything about it. Have you tried to see if it wors out of the box? To my knowledge the driver should be able to handle the encoding by itself.
If you have already tried, are you facing any issues?
Thanks for the reply, I believe the issue I was running into was the fixed size of 256 which would cause an exception in the ODBC driver when accessing a stored image. The data type of the column is memo
. Thoughts on querying the column data size and allocating memory accordingly?
Thank you.
final columnName = calloc.allocate<Uint16>(sizeOf<Uint16>() * 256);
tryOdbc(
_sql.SQLDescribeColW(
hStmt,
i,
columnName.cast(),
256,
columnNameLength,
nullptr,
nullptr,
nullptr,
nullptr,
),
handle: hStmt,
onException: FetchException(),
);
Yes it definitely could be. I will expose a way to provide column size. In the mean time please try if you can fix the issue by giving a higher value final columnValue = calloc.allocate<Uint16>(sizeOf<Uint16>() * 256)
here than 256.
Edit: It also could be the fact I provide a hardcoded value as SQL_C_WCHAR
as column type when fetching data.
Refer the code down below
_sql.SQLGetData(
hStmt,
i,
SQL_C_WCHAR,
columnValue.cast(),
256,
columnValueLength,
),
@dweberlj I updated the package to version 2.0.0+1 Please provide the column type to the execute method and set the size of the column to the required value and see if it fixes your issue. Keep me posted on your progress.
For more information refer to the updated documentation.
Closing due to inactivity
Hello!
How do we use this with an ANSI database?
Thanks, Dean