PHP - Conexión SQL Server - mssql_connect() [function.mssql-connect]: Unable to connect to server

   
Vista:

Conexión SQL Server - mssql_connect() [function.mssql-connect]: Unable to connect to server

Publicado por Fernando (13 intervenciones) el 21/07/2017 01:45:06
Buenas noches,

Tengo un problema al tratar de conectar en mi equipo con un SQL SERVER remoto, me devuelve el siguiente error:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 172.22.108.154 in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 2

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 3

Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 4

Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 4

Warning: mssql_fetch_object(): supplied argument is not a valid MS SQL-result resource in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 5

Warning: mssql_free_result(): supplied argument is not a valid MS SQL-result resource in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 10

Warning: mssql_close(): supplied argument is not a valid MS SQL-Link resource in C:\Servidor\Web\temp\logic\nuevojob\index.php on line 11

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
$con=mssql_connect("172.22.108.154","sa","Novembre99");
$db=mssql_select_db("ASCARMex",$con);
$result=mssql_query("select JobN from OpenJob order by JobN asc;");
while($row=mssql_fetch_object($result))
{
$data.= $row->JobN." ";
}
$data.="VACIO";
mssql_free_result($result);
mssql_close($con);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #666666;
	font-weight: bold;
}
-->
</style>
<script type="text/javascript" src="js/agregarsku.js"></script>
<script src="js/jquery-latest.js"></script>
  <link rel="stylesheet" href="css/autocomplete.css" type="text/css" />
  <link rel="stylesheet" href="css/autocomplete1.css" type="text/css" />
<script type="text/javascript" src="js/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="js/jquery.dimensions.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
<script>
  $(document).ready(function(){
    var data = "<?php echo $data; ?>".split(" ");
$("#job").autocomplete(data);
  });
  </script>
</head>
 
<body>
<div align="center">
  <br><br>
  <p><img src="sqr_logo.png" width="196" height="64" /></p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <form id="form1" name="form1" method="post" action="printjob.php">
    <span class="style1">JOB</span><br />
    <input type="text" name="job" id="job" />
    <br />
    <input type="submit" name="button" id="button" value="Visualizar" />
  </form>
 
 
 
</div>
</body>
</html>

Este código tal cual me funciona correctamente en otro equipo con Ubuntu, pero al querer migrar a otro equipo con Windows aparecen los errores.

Gracias por su apoyo.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder