Closed jubalh closed 1 year ago
On 26/09/2022 13:10, Michael Vetter wrote:
I have a case where queries are failing but no error is returned. To get more information we wanted to to check the trace file. However we didn't get to work properly. There was no tracefile written.
It depends on what you want to trace. If you want the driver manager to generate a log then its set in odbcinst.ini
[ODBC] Trace=Yes Tracefile=/tmp/sql.log
The way you are setting it will be passed to the driver and may or may not enable driver tracing, thats down to the driver.
If you want to enable driver manager tracing programmatically then
SQLSetConnectAttr( SQL_ATTR_TRACE )
and
SQLSetConnectAttr( SQL_ATTR_TRACEFILE )
Is the way
If you want the driver manager to generate a log then its set in odbcinst.ini
That worked! Thanks for the explanation.
I have a case where queries are failing but no error is returned. To get more information we wanted to to check the trace file. However we didn't get to work properly. There was no tracefile written.
Here is an example to illustrate that:
/etc/unixODBC/odbc.ini:
Code:
It seems neither when using
SQLConnect()
norSQLDriverConnect()
a trace file is created.@lurcher do you have any idea what could be the cause of this?