View Full Version : MSSQL Connection Problem

December 20th, 2010, 05:08 PM
http://ubuntuforums.org/images/icons/icon8.gif MSSQL Connection Problem
I have installed MSSQL Server 2005 in a Windows XP Pro machine.
IP =
Username = sa
Password = dontcry
Port = 1433
Database = master
Table = student (id int,name varchar(20)
Telnet service is up. SQL Client is also installed. I can fetch all data from “student” table from Windows XP Pro.

I have installed Ubuntu Server 10.04 LTS in an AMD-64bit Server machine.
IP =
I am able to Ping and Telnet to from Ubuntu Server. I also enabled Telnet service, also install LAMP in Server. I write a PHP code to fetch MSSQL data from database server. PHP code is

$conn = odbc_connect(“myown”,”sa”,”dontcry”);
$stm = “select * from student”;
$rs = odbc_exec($conn,$stm);
$show = odbc_result($rs,1);
echo $show;
Some other settings on Ubuntu Server are,

host =
port = 1433
tds version = 7.0

myown = myownDSN
Driver = FreeTDS
Description = myownDSN
Trace = No
Servername = myserver
Database = master

Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
CPTimeout =
CPReuse =
Problem is, I am not able to see the data? What should I do next….?

December 20th, 2010, 05:23 PM
you are running mysql, so why don't you use mysql functions instead of odbc?


December 20th, 2010, 05:36 PM
MySQL is in Ubuntu Server and MSSQL (Microsoft SQL Server 2005) is in Windows server. Web server (apache2) is in Ubuntu. I intend to connect MSSQL in Windows from Ubuntu to fetch data.

N.B. I know how to connect MySQL using PHP....:)

December 20th, 2010, 05:54 PM
oh, mssql. sorry, lol.

December 23rd, 2010, 07:02 PM
No one interested ... giving suggestion...;)

December 23rd, 2010, 07:13 PM
I'll admit from the off I know a little about MSSQL and nothing about php, but I did find this link: http://ubuntuforums.org/showthread.php?t=1098688 - useful?