Skip to Content.
Sympa Menu

freetds - Re: [freetds] New to FreeTDS / ODBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chad Udell <chadu AT mac.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] New to FreeTDS / ODBC
  • Date: Tue, 24 Jun 2003 21:49:09 -0500

James thanks for the reply..

my odbc.ini file contains the following:
[TDS]
Description = TDS
Driver = TDS
Servername = 192.168.0.3
Database = ARMCODATA
UID = username
PWD = password
Port = 1433

my freetds.log file looks like this:

Starting log file with debug level 99.
2003-06-24 18:09:20.024020 iconv will convert client-side data to the "" character set
2003-06-24 18:09:20.024436 Connecting addr 192.168.0.3 port 1433 with TDS version 4.2

Having worked exclusively in the LAMP world, trying to integrate this linux box with a Windows MSSQL server is certainly not easy.
I'm sure I must seem pretty ignorant. Sorry for my newbie-ness.

Chad


On Tuesday, June 24, 2003, at 09:33 PM, James K. Lowden wrote:

On Tue, 24 Jun 2003 16:45:01 -0500, Chad Udell <chadu AT mac.com> wrote:
I am attempting to setup a Redhat Linux 9 box with PHP 4.2.2 and Apache
2.0.40 to connect with a MSSQL server database using FreeTDS. This has
been headache after headache.

i am able to connect with tsql fine. My ODBC connection scripts from
PHP on the other hand are a bit different...

I am currently getting the following error:
SQL error: [unixODBC]Client unable to establish connection, SQL state
S1000 in SQLConnect in /var/www/html/rossmach/odbc_test.php

the error is coming from this statement:
$connection =
odbc_connect("Driver=TDS;Server=192.168.0.3:1433;Database=ARMCODATA",
"username", "password", "Integrated Security=NO")

The "server" doesn't refer to the DNS name or ip address of the machine
hosting the database server. It refers to the servername as denoted in
your odbc.ini or freetds.conf. If you are trying to skip odbc.ini, then
I think you want "Server=TDS" above.

Export TDSDUMP and have a look. My guess is that so far FreeTDS will
report it's not being passed a servername that it can find in
freetds.conf. When it is passed a good name, you'll be more than halfway
home.

If you're really stuck, export TDSDUMPCONFIG, too. If you write back
here, please include the relevant section(s) of your odbc.ini, too.

HTH.

--jkl

My freetds.conf file contains this info for the DSN:
[TDS]
host = 192.168.0.3
port = 1433
tds version = 4.2





Archive powered by MHonArc 2.6.24.

Top of Page