[unixODBC-support] unixODBC skipping every other char in status messages.

ML d4t4full at gmail.com
Thu Nov 19 15:15:40 GMT 2015


Hi, there, first post but long time (final) user of unixODBC. My excuses
for the length.

My setup is two Desktop Ubuntu 14.04.3 LTS (a 64-bit host and a 32-bit
virtual machine), and I'm using unixODBC with FreeTDS on both to connect
to MSSQL Servers.
The problem I have is in a C command-line program I created (two
versions compiled, 32-bit and 64-bit) which tries to connect to a server
and run a user-typed query.

The program works as long as the connection string I feed to
SQLDriverConnect() is right, but it fails with very weird messages if
-for example- the Database, Username or Password are not right.
It does not matter the MSSQL version I connect because the connection
attempt fails (on purpose, when I feed bad data).
I do this in order to see if I can infer better messages to the final
user of my program, but it is the programmer in this case that's baffled...

I am not using DSNs at all. In fact, this all started because I want to
add connection string support to the Gambas3 gb.db.odbc component (which
I did).
Just in case, this is an example connection string I would feed the
program via command-line:

 
"DRIVER=FreeTDS;TDS_VERSION=7.2;SERVER=<serverNameOrIP>;PORT=<tcpPort>;UID=<username>;PWD=<passowrd>;DATABASE=<database>"

The problem is that it looks like the response text skips every other
character, making the message completely unreadable.
Please note that only unixODBC messages are affected, while driver
messages (FreeTDS in these two cases) are OK.
Tried changing TDS_VERSION to 0, 4.2, 7, 7.3, etc, with the same
outcome, but those are driver directives.
The problem affects both 32 and 64 bits versions of the program.

A sample unixODBC error from the 32-bit version where I supplied a bad
password on purpose (first line is text printed from the program itself):

  The driver reported the following diagnostics whilst running
SQLDriverConnect or SQLConnect (-1)
  400::1:18456:[nxDC[reD]SLSre]oi aldfrue Pacr'
  001::2:0:[nxDC[reD]SLSre]nbet onc odt ore;Ph�

Here's also a sample from the 64-bit version, trying the same bad
password above:

  The driver reported the following diagnostics whilst running
SQLDriverConnect or SQLConnect (-1)
  400:1:18456:[nxDC[reD]SLSre]oi aldfrue Pacr'
  001:2:0:[nxDC[reD]SLSre]nbet onc odt ore�[

And another sample, this time trying with MDBTools against an MDB file
with the 64-bit version:

  The driver reported the following diagnostics whilst running
SQLDriverConnect or SQLConnect (-1)
  001:1:1:[nxDCCudntfn S o B ncnetsrn

My guess is that the text [nxDC is actually [unixODBC], but with every
other character skipped.
Likewise, [reD] would be [FreeTDS], SLSre] would be [SQLServer].
Also, in the MDB case, [nxDCCudntfn may be [unixODBC]Could not find. I
cannot make heads or tails of the rest of the text.

Is anybody else having this issue? What would the solution be?

TIA,
zxMarce.


More information about the unixODBC-support mailing list