Skip to Content.
Sympa Menu

freetds - [freetds] Domain Auth to MS SQL - PHP/FreeTDS 0.61

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Chris Hettinger" <chettinger AT encompas.com>
  • To: "FreeTDS Development Group (E-mail)" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Domain Auth to MS SQL - PHP/FreeTDS 0.61
  • Date: Tue, 19 Aug 2003 11:49:10 -0500

I'm back with an update and question:

I have freeTDS 0.61 libraries installed, and I now have PHP recompiled with
the inclusion of MSSQL support. I am using a very simple script to test my
connection to the SQL DB, but again am running into:
=====================
$db_host = '192.168.1.245';
$db_user = 'chettinger';
$db_pass = '<PASSWORD>';
$db_database = 'PHPTEST';

include("../adodb/adodb.inc.php");
include("../adodb/tohtml.inc.php");

// Do database connection
ADOLoadCode('mssql');
$db = NewADOConnection('mssql');
if(!$db->Connect($db_host, $db_user, $db_pass, $db_database))
{
message_die(CRITICAL_ERROR, "Could not connect to the database", __LINE__,
__FILE__);
}

//
// Select data
//
$sql = "SELECT * FROM profile";
echo "<font color=blue size=1><br>".$sql."</font><p>";
$rsData = $db->Execute($sql);

if(!$rsData){
print "Bad";
}else{
print "Good";
}
=====================
I receive two warnings:
Login failed for user 'chettinger'. Reason: Not associated with a trusted SQL
Server connection
Unable to connect to server: 192.168.1.245
But my if statement still prints "Good"

Our SQL Server is set up to use NT domain authentication.
My freetds.conf:

[ENCPPP]
host = 192.168.1.245
port = 1433
tds version = 7.0
try domain login = yes
try server login = no
nt domain = ENCOMPASS

TSQL:
$ tsql -S ENCPPP -U chettinger <--------- My domain login.
locale is "en_US"
using default charset "ISO-8859-1"
Password:
Msg 5703, Level 0, State 1, Server ENCPPP, Line 0
Changed language setting to us_english.
1>

... It appears as though FreeTDS is there and I can connect correctly.


My question is, though I have recompiled php and the freetds libraries are on
the server, how can I test they are communicating? Or have I missed something?


-Chris Hettinger, Web Specialist
-IFMC/ENCOMPASS
-www.encompas.com
-(515) 223.2947




CONFIDENTIALITY NOTICE: This communication, including any attachment, may
contain confidential information and is intended only for the individual or
entity to whom it is addressed. Any review, dissemination, or copying of
this communication by anyone other than the intended recipient is strictly
prohibited. If you are not the intended recipient, please contact the sender
by reply email, delete and destroy all copies of the original message.'





Archive powered by MHonArc 2.6.24.

Top of Page