Skip to Content.
Sympa Menu

freetds - Re: [freetds] SQLGetTypeInfo() fails when it is called for the second time (10/08/2008 Dmitry Basko)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: Marko Polloto <marko68 AT gmx.net>, FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] SQLGetTypeInfo() fails when it is called for the second time (10/08/2008 Dmitry Basko)
  • Date: Wed, 8 Oct 2008 18:16:42 -0400

marko68 GMX wrote:
>
> find_an_appropriate_data_type(...)
> {
> SQLBindCol(hToStmt, 1, SQL_C_CHAR, szTypeName ...);
> SQLBindCol(hToStmt, 3, SQL_C_LONG, &cbMaxPrec,...);
> ...
> SQLGetTypeInfo(hstmt, fSqlType) (where fSqlType is 5 (small integer))
> SQLFetch(hstmt);
> ...
> SQLFreeStmt(hstmt, SQL_CLOSE);
>
> if !(does_the_found_MS_SQL_data_type_suit_us)
> try another one;
> }
> The main idea behind this cycle is an attempt to figure out the right
> correspondence between available (supported by the application) data
> types and the ones supported by MS SQL. The first call of the
> function returns the requested type info, but the second call
> fails: SQLGetTypeInfo returns -1. The call of SQLGetDiagRec
> returns the following error:
>
> 08S01 - [FreeTDS][SQL Server]Communication link failure

Please post a TDSDUMP log of the session. Perhaps that will shed some
light.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page