freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Mikhail Grosman <mgrosman AT pathcom.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] SQL_ATTR_TRACE option doesn't work
- Date: Wed, 07 Apr 2010 20:25:42 -0400
On 07/04/2010 6:32 PM, James K. Lowden wrote:
mgrosman AT pathcom.com wrote:But it works when I use it before SQLConnect. I think the reason is that after SQLConnect the DM loads FreeTDS library and then some calls to SQLSetConnectAttr are passed through to the driver including SQL_ATTR_TRACE, which I think it shouldn't do.
I'm calling this API:http://msdn.microsoft.com/en-us/library/ms713605(VS.85).aspx
::SQLSetConnectAttr(
hdbc,
SQL_ATTR_TRACE,
(SQLPOINTER)sitrace,
0 );
where sitrace is one of SQL_OPT_TRACE_ON or SQL_OPT_TRACE_OFF
and get this error back:
HY092, Native error: 0, Msg: [FreeTDS][SQL Server]Invalid option;
I checked the source code in odbc.c and found that unless TDS_NO_DM is
defined the driver doesn't understand this option.
It's normally a DM feature:
"An SQLUINTEGER value telling the Driver Manager whether to perform
tracing:
SQL_OPT_TRACE_OFF = Tracing off (the default)
SQL_OPT_TRACE_ON = Tracing on
When tracing is on, the Driver Manager writes each ODBC function call to
the trace file."
It's not supported by the driver unless there's no DM present. If you
removed the preprocessor guards, I would think you'd hit some kind of
conflict.
HTH.
--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
So it looks like a bug in DM, not in FreeTDS.
On Windows it works fine because of different DM.
Mikhail
-
[freetds] SQL_TXN_ISOLATION_OPTION,
mgrosman, 04/01/2010
- Re: [freetds] SQL_TXN_ISOLATION_OPTION, Frediano Ziglio, 04/01/2010
-
[freetds] SQL_ATTR_TRACE option doesn't work,
mgrosman, 04/01/2010
-
[freetds] bulk copy API,
mgrosman, 04/06/2010
-
Re: [freetds] bulk copy API,
Frediano Ziglio, 04/07/2010
-
Re: [freetds] bulk copy API,
mgrosman, 04/07/2010
-
Re: [freetds] bulk copy API,
jklowden, 04/07/2010
- Re: [freetds] bulk copy API, mgrosman, 04/07/2010
-
Re: [freetds] bulk copy API,
jklowden, 04/07/2010
-
Re: [freetds] bulk copy API,
mgrosman, 04/07/2010
-
Re: [freetds] bulk copy API,
Frediano Ziglio, 04/07/2010
-
Re: [freetds] SQL_ATTR_TRACE option doesn't work,
James K. Lowden, 04/07/2010
- Re: [freetds] SQL_ATTR_TRACE option doesn't work, Mikhail Grosman, 04/07/2010
-
[freetds] bulk copy API,
mgrosman, 04/06/2010
Archive powered by MHonArc 2.6.24.