Re: FreeTDS on Debian: connect to MSSQL with ODBC fails

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
2011/1/10 Boniforti Flavio <[email protected]>:
> Hello Frediano, hello list.
>
> Sorrz for getting back to this so late...
>
>> Just to recall
>
> The configs are still as zou wrote...
>
>> tsql is working:
>>
>> # tsql -S sqlexpress -U sa
>> locale is "it_CH.UTF-8"
>> locale charset is "UTF-8"
>> Password:
>> 1>
>
> Yes it is
>
>> You can go through steps:
>>
>> 1: odbc.ini that points to freetds.conf
>>
>> /etc/odbc.ini:
>>
>> [sqlexpress]
>> Servername = sqlexpress
>> Driver = FreeTDS
>>
>> # isql -v sqlexpress sa
>>
>> should work
>
> It does *not* work:
>
> root@ticket:~# cat /etc/odbc.ini
> [sqlexpress]
> Servername = sqlexpress
> Driver = FreeTDS
>
> root@ticket:~# isql -v sqlexpress sa
> [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
> [37000][unixODBC][FreeTDS][SQL Server]Accesso non riuscito per l'utente
> 'sa'.
> [ISQL]ERROR: Could not SQLConnect
>

Mmmm... "[FreeTDS]" means that unixODBC is loading and using FreeTDS
driver. On the other side "Accesso non riuscito..." means that isql is
actually connecting to a sql server (the Italian error came from sql
server). If tsql works this means that odbc driver should connect (no
ssl or tcp/ip protocol problems). I don't know how isql works without
a password but try to pass password to isql like

# isql -v sqlexpress sa your_password

This has security impacts (anybody logged in the system while
executing isql command can read command line!) but for a test in your
personal machine this is not a problem.

>> 2: move freetds.conf entries to odbc.ini
>>
>> /etc/odbc.ini:
>>
>> [sqlexpress]
>> Server = 172.16.16.254
>> Port = 1433
>> TDS_Version = 8.0
>> Driver = FreeTDS
>>
>> # isql -v sqlexpress sa
>
> This too is not working:
>
> root@ticket:~# cat /etc/odbc.ini
> [sqlexpress]
> Server = 172.16.16.254
> Port = 1433
> TDS_Version = 8.0
> Driver = FreeTDS
>
> root@ticket:~# isql -v sqlexpress sa
> [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
> [37000][unixODBC][FreeTDS][SQL Server]Accesso non riuscito per l'utente
> 'sa'.
> [ISQL]ERROR: Could not SQLConnect
>
> Anz help will be appreciated...
>
> Thanks,
> Flavio Boniforti
>

Regards
  Frediano Ziglio
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.