mTv
mTv

Reputation: 1356

How to handle text columns with ODBC Driver 13 for SQL Server

Previously we have been using sybase with an Adaptive Server Enterprise driver. Currently we are in the process of switching to MSSQL and will then be using an ODBC Driver 13 for SQL Server.

We keep getting Invalid Descriptor Index errors we didn't get with sybase when calling SQLGetData on an unbound column with index i while the highest bound column has index i+n. This makes sense according to the SQLGetData doc

On the other hand, what isn't making sense to me is that SQLGetInfo with type 81(SQL_GETDATA_EXTENSIONS) returns an empty string for both drivers. I Would expect the sybase one to return something signifying that it has the property SQL_GD_ANY_COLUMN

My question is: Is there a way to give the ODBC Driver 13 for SQL Server the SQL_GD_ANY_COLUMN property? If not, how should one then handle text columns of varying lengths(Shouldn't bind those with SQLBind?)?

I'm very new with this so any insight appreciated:)

Upvotes: 1

Views: 492

Answers (1)

Henrik Høyer
Henrik Høyer

Reputation: 1662

You cannot change the driver behaviour. I recommend that you make repeated calls to the SQLGetData ODBC function for the text/varchar(max) columns

Upvotes: 1

Related Questions