-1

I’ve tried several different config options based on this page (http://enlook.wordpress.com/2013/05/02/error-sql-error-unixodbcdriver-managerdata-source-name-not-found-and-no-default-driver-specified/#comment-2783)

And a very similar post here at Connecting MS SQL using freetds and unixodbc: isql - no default driver specified however when I try to test the connection with isql I continue to get “[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified [ISQL]ERROR: Could not SQLConnect”.

I am running Ubuntu 12.04 LTS server and installed freeTDS via apt-get.

results of odbcinst -q -d:

@cabana:/etc# odbcinst -q -d
[TDSDRIVER]

results of odbcinst -q- s

@cabana:/etc# odbcinst -q -s
[MSSQL]
[SQL01]

tds.driver.template:

@cabana:/etc# cat tds.driver.template
[TDSDRIVER]
Description = FreeTDS driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
FileUsage = 1
UsageCount =1

tds.datasource.template:

@cabana:/etc# cat tds.datasource.template
[SQL01]
Driver = TDSDRIVER # name that we specified in the driver file
Description = MSSQL ODBC Driver
Trace = No
TraceFile = /var/log/freetds.log
Server = 10.0.0.200 # this name specified in the freetds.conf
Port = 1433
Database = MyDatabase
TDS_Version = 8.0

freetds.conf:

@cabana:/etc# cat freetds.conf
[global]
tds version = 8.0
[MICROSOFT]
host = 10.0.0.200
port = 1433
tds version = 8.0

odbc.ini:

@cabana:/etc# cat odbc.ini
[MSSQL]
Driver = FreeTDS # name that we specified in the driver file
Description = MSSQL ODBC Driver
Trace = No
TraceFile = /var/log/freetds.log
Servername = 10.0.0.200 # this name specified in the freetds.conf
Port = 1433
Database = MyDatabase
TDS_Version = 7.0

[SQL01]
Driver = TDSDRIVER # name that we specified in the driver file
Description = MSSQL ODBC Driver
Trace = No
TraceFile = /var/log/freetds.log
Server = 10.0.0.200 # this name specified in the freetds.conf
Port = 1433
Database = MyDatabase
TDS_Version = 8.0

odbcinst.ini:

@cabana:/etc# cat odbcinst.ini
[TDSDRIVER]
Description = FreeTDS driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
FileUsage = 1
UsageCount = 2

tsql is not installed so testing with isql I get this:

@cabana:/etc# isql -v SQL01 user pass
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

What am I doing wrong?

Malchesador
  • 121
  • 2
  • 5
  • Does anyone have any ideas on this? I see there is still no response. – Malchesador May 16 '14 at 13:52
  • I'm trying to create an odbc sql-server connection and I'm on the same point. But there is one thing, you could use `tsql`. There is a tool that helps you test your connection: – ssoto May 27 '14 at 07:53
  • Are you sure that your odbcinst is reading the config from the right path? Try with -j option of odbcinst: `odbcinst -j` – ssoto May 27 '14 at 08:08
  • Yes it is reading from the right path. Unfortunately tsql does not install with the Ubuntu odbc package. – Malchesador May 27 '14 at 17:32

1 Answers1

0

I just came out with a similar issue: The problems with MS SQL can be ports or instances. I suggest you to run:

tsql -LH [SERVER_IP_ADR]

Get port number and update freetds.conf

If your server is using instances (i.e. Instance name differs from MSSQLSERVER) you can also try to update /etc/odbc.ini with:

Server  = [SERVER_IP_ADR]\\[INSTANCE_NAME]

It worked for me.

Replace square brackets with the respective value.

Byte Commander
  • 105,631
  • 46
  • 284
  • 425
Stefano
  • 1
  • 1