通达OA2015和2016链接sqlserver数据库的几种方式

"CMCCMAS", "UID"=>"sa", "PWD"=>"123456");
	$conn = sqlsrv_connect( $serverName, $connectionInfo);
		//$odb_conn=sqlsrv_connect('192.168.1.62,1433','sa','123456');
		 if($conn)
       {
       echo "连接成功!";
       } else {
		   echo "链接失败!";
		   die( print_r( sqlsrv_errors(), true));
		   }
	   
		 //  echo "
"; //连接2000 $dbhost = '192.168.1.122,1433'; $dbuser ='sa'; //你的mssql用户名 $dbpass = '123456'; //你的mssql密码 $dbname = 'CMCCMAS'; //你的mssql库名 $connect=odbc_connect("Driver={SQL Server};Server=$dbhost;Database=$dbname",$dbuser,$dbpass); if($connect) { echo "连接成功"; } else { echo "链接失败!"; } $cnx = new PDO("odbc:Driver={SQL Server};Server=192.168.1.122,1433;Database=CMCCMAS;",'sa','123456'); if($cnx) { echo "连接成功"; } else { echo "链接失败!"; } ?>

你可能感兴趣的:(php学习研究,通达OA,sqlserver)