http://localhost/AFM/connectmssql.php
test connect mssql
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: SERVER-AFM\express in C:\AppServ\www\afm\connectmssql.php on line 9
connect server fail
<?
$servername="SERVER-AFM\express"; ===> อยู่อีกเครื่อง (เป็น file server)
$username="Sa";
$pass="Passw0rd";
$connect_serv_fail="connect server fail";
$dbname="DBAFM";
echo "test connect mssql";
//$connection = mssql_connect("192.168.100.1",$username,$pass) or die("connect server fail");
$connection = mssql_connect($servername,$username,$pass) or die("connect server fail");
$db=mssql_select_db($dbname,$connection) or die("connect database fail");
?>
phpinfo.php
Code
mssql
MSSQL Support enabled
Active Persistent Links 0
Active Links 0
Library version 7.0
Directive Local Value Master Value
mssql.allow_persistent On On
mssql.batchsize 0 0
mssql.compatability_mode Off Off
mssql.connect_timeout 5 5
mssql.datetimeconvert On On
mssql.max_links Unlimited Unlimited
mssql.max_persistent Unlimited Unlimited
mssql.max_procs Unlimited Unlimited
mssql.min_error_severity 10 10
mssql.min_message_severity 10 10
mssql.secure_connection Off Off
mssql.textlimit Server default Server default
mssql.textsize Server default Server default
mssql.timeout 60 60