Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 13.04 and I installed Wine 1.6. I am running a dotnet application through Wine, but I am getting the following error message:

An error occurred while establishing connection to the server. When connecting to SQL server 2005,this failure may be caused by the fact that under the default setting SQL server does not allow remote connections.

The dotnet framework 2.0 installed in Ubuntu client. But the same dotnet applications runs in Windows client machines (Windows 7/Windows XP).

Do I need to establish connections manually to that server? Or do I need to install any application for this to establish connections?

share|improve this question

You don't have to use Wine for this purpose. Connecting Ubuntu to a Microsoft SQL server is not really possible as the Microsoft MDAC doesn't install on Ubuntu, even in Wine. Here is a good guide that I found in this sense:

Here is a quick overview:

  1. Install all the packages needed to get connected to SQL server:

    sudo apt-get install iodbc libiodbc2 libct3 tdsodbc unixodbc
  2. Edit /etc/odbcinst.ini file and add the following:

    Description = FreeTDS Driver
    Driver = /usr/lib/odbc/
    Setup = /usr/lib/odbc/
    FileUsage = 1
    CPTimeout = 5
    CPReuse = 5
  3. Edit /etc/odbc.ini file and add the following:

    [ODBC Data Sources]
    MyServerDSN = FreeTDS Connection Server
    Driver = FreeTDS
    Description = FreeTDS Connection Server
    Servername = MyServer
    Database = MyDatabase
  4. Edit /etc/odbc.ini file and add the following at the end of file:

    host = x.x.x.x
    port = 1433
    tds version = 8.5
  5. Connect to SQL server:

    isql -v MyServerDSN MyUserName MyPass
share|improve this answer
it shows the following error message when i tried this command :$ administrator@SRMCUBUNTU:~$ sudo apt-get install iodbc libiodbc2 libct3 tdsodbc unixodbc [sudo] password for administrator: Reading package lists... Done Building dependency tree Reading state information... Done Package libct3 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: freetds-common E: Package 'libct3' has no installation candidate – jagadeesh Aug 24 '13 at 10:05
and also after entering this command : administrator@SRMCUBUNTU:~$ /etc/odbcinst.ini bash: /etc/odbcinst.ini: Permission denied what shall i do please help me – jagadeesh Aug 24 '13 at 10:08
@jagadeesh To edit those files use for example: sudo gedit /etc/odbcinst.ini. You will never edit a file from terminal only inserting its name. – Radu Rădeanu Aug 24 '13 at 10:19
@jagadeesh At the first step you can try only with: sudo apt-get install iodbc libiodbc2 tdsodbc unixodbc – Radu Rădeanu Aug 24 '13 at 10:20
i did everything but still it is not working . myserver should be my server name ? and wat abt host ? please help ....and in windows i dont need to assign ip address username password nothing ...... – jagadeesh Aug 28 '13 at 8:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.