Skip to Content.
Sympa Menu

freetds - Re: [freetds] Problem with the latest Sybase ODBC driver

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Igor Korot <ikorot01 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Problem with the latest Sybase ODBC driver
  • Date: Wed, 4 Jul 2018 12:54:28 -0500

Frediano,

On Tue, Jul 3, 2018 at 12:09 AM, Frediano Ziglio <freddy77 AT gmail.com> wrote:
> 2018-07-01 6:08 GMT+01:00 Igor Korot <ikorot01 AT gmail.com>:
>> Frediano,
>>
>> On Sat, Jun 30, 2018 at 8:08 PM, Igor Korot <ikorot01 AT gmail.com> wrote:
>>> Frediano,
>>> Any idea why freeTDS fails to connect?
>>
>
> Too many issues in this thread, I'm a bit confused, from Sybase
> libraries to crash to ODBC settings, I'll try to reply to this one

Sorry about that.
Let's concentrate on the freeTDS ODBC connection right now.

>
>> I was able to connect with tsql by adding to freetds.conf:
>>
>> [code]
>> [MySybase]
>> host = IGORREINCLOUD
>> port = 5000
>> tds version = 5.0
>> [/code]
>>
>> and then doing from the command prompt:
>>
>> [code]
>> igor@IgorReinCloud ~/dbhandler $ tsql -S MySybase -U dba -P wasqra
>> locale is "en_US.utf8"
>> locale charset is "UTF-8"
>> using default charset "UTF-8"
>> Msg 4002 (severity 14, state 1) from IGORREINCLOUD:
>> "Login failed.
>> "
>
> This is failing, I suspect you are trying a wrong user/password

Yes, there was. Sorry about that.

>
>> There was a problem connecting to the server
>> igor@IgorReinCloud ~/dbhandler $ tsql -S MySybase -U sa -P wasqra
>> locale is "en_US.utf8"
>> locale charset is "UTF-8"
>> using default charset "UTF-8"
>> Msg 5704 (severity 10, state 1) from IGORREINCLOUD:
>> "Changed client character set setting to 'iso_1'.
>> "
>
> This is a successful connection.
>
>> 1> USE draft;
>> 2> go
>> Msg 102 (severity 15, state 181) from IGORREINCLOUD Line 1:
>> "Incorrect syntax near ';'.
>> "
>> 1> USE draft
>> 2> go
>> 1> SELECT * FROM leagues
>> 2> go
>> id name drafttype scoringtype roundvalues leaguetype
>> salary benchplayers
>> 1 Demo - Roto (Auction) 1 1 1 demo 260 0
>> 2 Demo - Roto (Draft) 3 1 1 demo 260 0
>> 3 Demo - Points (Auction) 1 2 1 demo 260 0
>> 4 Demo - Points (Draft) 3 2 1 demo 260 0
>> (4 rows affected)
>> 1> quit
>> igor@IgorReinCloud ~/dbhandler $
>> [/code]
>>
>> Do you see any issues with my freeTDS ODBC configuration?

Now when I tried to connect with ODBC driver I see following in the sql.log:

[code]
[ODBC][30927][1530736662.061920][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][3727]
Entry:
Connection = 0x23d8050
Server Name = [Sybase_16_freeTDS][length = 17 (SQL_NTS)]
User Name = [sa][length = 2 (SQL_NTS)]
Authentication = [******][length = 6 (SQL_NTS)]
UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE'

DIAG [01000] [FreeTDS][SQL Server]Adaptive Server connection failed

DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to data source

[/code]

This is with the:

In the odbcinst.ini:
[code]
[Sybase_freeTDS]
Description=Sybase FreeTDS Driver
Driver=/usr/lib64/libtdsodbc.so
TDS_Version = 5
UsageCount=3
[/code]

In the odbc.ini:
[code]
[Sybase_16_freeTDS]
Description=Sybase 16 freeTDS ODBC driver
Driver=Sybase_freeTDS
Port=5000
Server=IGORREINCLOUD
UserID=sa
Password=wasqra
Database=draft
Option=3
[/code]

Anything wrong here with my setup?

Thank you.
>>
>
> Looking back at ODBC I would say the option is "TDS_Version", not "TDS
> Version", see http://www.freetds.org/userguide/odbcconnattr.htm.

Should this option be in odbc.ini rather than in odbcinst.ini?

> Usually the steps I take are setting up tsql, then use "Servername" in
> odbc.ini then more from freetds.conf to odbc.ini the various settings
> to get an odbc only configuration.
>
> At the beginning you were using Sybase drivers, with FreeTDS you can
> use TDSDUMP and TDSDUMPCONFIG environment to help debugging, see
> http://www.freetds.org/userguide/logging.htm.

Yes, I did.
But with the native driver while I did connect the simple query segfaulted on
my
database (draft). The crash happened somewhere inside the Sybase driver.
I did created the thread on the sap community forum website and hopefully
someone will look into that.
But I was hoping that making freeTDS driver working will help me to at least
continue to do my development.

Thank you.

>
>> Thank you.
>>
>>>
>>> Thank you.
>>>
>>>
>>> On Thu, Jun 28, 2018 at 8:02 AM, John Kendall <john AT capps.com> wrote:
>>>>
>>>>> On Jun 28, 2018, at 5:36 AM, Igor Korot <ikorot01 AT gmail.com> wrote:
>>>>>
>>>>> Hi, John,
>>>>>
>>>>> On Wed, Jun 27, 2018 at 11:14 AM, John Kendall <john AT capps.com> wrote:
>>>>>> Igor,
>>>>>> I'm on Centos 7.5 and it looks like I'm using the exact same version
>>>>>> of ASE:
>>>>>> Adaptive Server Enterprise/16.0 SP02 PL02/EBF 25320
>>>>>> SMP/P/x86_64/Enterprise Linux/ase160sp02plx/2492/64-bit/FBO/Sat Nov 21
>>>>>> 04:05:39 2015
>>>>>>
>>>>>> I'm using unixODBC 2.3.1 and the freeTDS odbc driver without issue.
>>>>>> I recall having the Sybase ODBC driver working, but settled on the
>>>>>> FreeTDS driver for simplicity.
>>>>>
>>>>> This is my setup:
>>>>>
>>>>> [code]
>>>>> igor@IgorReinCloud ~/dbhandler $ cat /etc/unixODBC/odbcinst.ini
>>>>> [ODBC]
>>>>> Trace=yes
>>>>> TraceFile=/tmp/sql.log
>>>>> Pooling=No
>>>>>
>>>>> [Sybase]
>>>>> Description=Sybase 16 Native Driver
>>>>> Driver=/opt/sap/DataAccess64/ODBC/lib/libsybdrvodb.so
>>>>> UsageCount=1
>>>>>
>>>>> [Sybase_freeTDS]
>>>>> Description=Sybase FreeTDS Driver
>>>>> Driver=/usr/lib64/libtdsodbc.so
>>>>> UsageCount=1
>>>>> igor@IgorReinCloud ~/dbhandler $ cat /etc/unixODBC/odbc.ini
>>>>> [ODBC Data Sources]
>>>>> Sybase_16_demo=Sybase 16 ODBC driver
>>>>> Sybase_16_test=Sybase 16 ODBC driver
>>>>> Sybase_16_freeTDS=Sybase_freeTDS
>>>>>
>>>>> [Sybase_16_demo]
>>>>> Description=Sybase 16 ODBC Driver
>>>>> Driver=Sybase
>>>>> Port=5000
>>>>> Server=IGORREINCLOUD
>>>>> UserID=sa
>>>>> Password=
>>>>> Database=pubs2
>>>>> Option=3
>>>>>
>>>>> [Sybase_16_test]
>>>>> Description=Sybase 16 ODBC native driver
>>>>> Driver=Sybase
>>>>> Port=5000
>>>>> Server=IG
>>>>> Server=IGORREINCLOUD
>>>>> UserID=sa
>>>>> Password=
>>>>> Database=draft
>>>>> Option=3
>>>>>
>>>>> [Sybase_16_freeTDS]
>>>>> Description=Sybase 16 freeTDS ODBC driver
>>>>> Driver=Sybase_freeTDS
>>>>> Port=5000
>>>>> Server=IGORREINCLOUD
>>>>> UserID=sa
>>>>> Password=
>>>>> Database=draft
>>>>> TDS Version=5.0
>>>>> Option=3
>>>>> [/code]
>>>>>
>>>>> And this is from the ODBC log for freeTDS driver:
>>>>>
>>>>> [code]
>>>>> [ODBC][15829][1530200010.883129][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][3727]
>>>>> Entry:
>>>>> Connection = 0x637050
>>>>> Server Name = [Sybase_16_freeTDS][length = 17 (SQL_NTS)]
>>>>> User Name = [sa][length = 2 (SQL_NTS)]
>>>>> Authentication = [******][length = 6 (SQL_NTS)]
>>>>> UNICODE Using encoding ASCII 'UTF8' and UNICODE 'UTF16LE'
>>>>>
>>>>> DIAG [01000] [FreeTDS][SQL Server]Adaptive Server connection
>>>>> failed
>>>>>
>>>>> DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to data
>>>>> source
>>>>>
>>>>> [ODBC][15829][1530200010.924065][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][4099]
>>>>> Exit:[SQL_ERROR]
>>>>> [/code]
>>>>>
>>>>> The native driver works OK - I can connect without any issues.
>>>>>
>>>>> Do you see any problems?
>>>>>
>>>>> I'm trying to connect with:
>>>>>
>>>>> isql Sybase_16_freeTDS sa <password>
>>>>>
>>>>> Thank you.
>>>>
>>>> Upon further investigation, my ODBC success is via PHP. I am having
>>>> problems with unixODBC isql as well.
>>>> So I'm no help.
>>>>
>>>>>
>>>>>>
>>>>>> John
>>>>>>
>>>>>>
>>>>>> On Jun 27, 2018, at 10:37 AM, Igor Korot
>>>>>> <ikorot01 AT gmail.com<mailto:ikorot01 AT gmail.com>> wrote:
>>>>>>
>>>>>> Hi, ALL,
>>>>>> This post is not directly related to the freeTDS, but I'm hoping that
>>>>>> someone can help.
>>>>>>
>>>>>> I have a latest Sybase 16.0 version Development Edition installed on
>>>>>> Linux.
>>>>>> I also have a unixODBC installed.
>>>>>>
>>>>>> I'm trying to connect to the server using the default Sybase ODBC
>>>>>> driver with the
>>>>>> unixODBC isql program.
>>>>>>
>>>>>> Unfortunately I have a problem. The connection works, but then issuing
>>>>>> the simple
>>>>>> query, like "SELECT * FROM <my_table>;", where my table is
>>>>>> locatedinside
>>>>>> my local database (the one I created) segfaults.
>>>>>> Trying to do the same with the Sybase demo database works fine.
>>>>>>
>>>>>> I didn't try to do anything with the freeTDS driver yet. I will
>>>>>> probably do that
>>>>>> over the weekend.
>>>>>>
>>>>>> Does anybody here have Sybase 16 installed? Did you try ODBC connection
>>>>>> to the server?
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> P.S.: Software versions:
>>>>>> 1> select @@version
>>>>>> 2> go
>>>>>>
>>>>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>> Adaptive Server Enterprise/16.0 SP02 PL02/EBF 25320
>>>>>> SMP/P/x86_64/Enterprise Lin
>>>>>> ux/ase160sp02plx/2492/64-bit/FBO/Sat Nov 21 04:05:39 2015
>>>>>>
>>>>>> (1 row affected)
>>>>>> 1> exit
>>>>>>
>>>>>> [/code]
>>>>>>
>>>>>> [code]
>>>>>>
>>>>>> [ebuild U ] dev-db/unixODBC-2.3.5-r1::gentoo [2.3.2-r1::gentoo]
>>>>>> USE="minimal unicode -odbcmanual -static-libs" ABI_X86="32 (64)
>>>>>> (-x32)" 1,596 KiB
>>>>>>
>>>>>> [/code]
>>>>>>
>>>>>> The current version of unixODBC is 2.3.2-r1 from gentoo repository.
>
> Not much experience with Gentoo, looks like directories are completely
> different.
>
> Frediano
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page