Monday, March 26, 2012

ODBC Descriptors

Hi All,

I am doing some research on the use of ODBC descriptors and hope that the community might have some opinions:

Is anybody out there using ODBC descriptors in their applications?
What are you using them for and why?
Are their alternatives to using them?

Thanks in advance,

Usually you don't need to use them. They add the ability to set certain attributes one by one istead of all at once using another API. For example, call SQLBindParameter to set the parameter number, its C-Type, its SQL-Type, precision, scale, etc...

You could set each individually by getting a descriptor handle, and then setting each value 1 by 1. You can use your imgination to find advantages to tweaking only 1 descriptor. There are other advantage as well, but you should probably look at the API SQLSetDescField( ) to get an idea of how descriptors can be used. (See http://msdn2.microsoft.com/en-us/library/ms713560.aspx)

The one time that you MUST you descriptors to bind a data type is the SQL_C_NUMERIC data type. Please see http://support.microsoft.com/kb/181254 for more information on this.

Good luck!

~Warren

sql

No comments:

Post a Comment