Warning: odbc_connect() [function.odbc-connect]: SQL error: Failed to fetch error message, SQL state HY000 in SQLConnect in D:\xampp\htdocs\Interroga\ConectarseBD.php on line 10
Failed to fetch error message
Y el código para acceder a ella es el siguiente:
Cita:
Porque me da ese error?? como puedo arreglarlo?? Otra cosa, yo probe este código con ejemplo desde el Zend Develoment Enviroment y se conecta y me devuelve los códigos que le pido...... Por favor ayuda!!!! $dsn = "prueba";
//debe ser de sistema no de usuario
$usuario = "";
$clave="";
//realizamos la conexion mediante odbc
$conn=odbc_connect($dsn, $usuario, $clave) or die (odbc_errormsg());;
if (!$conn) {
print "<p>Imposible conectarse con la base de datos.</p>";
exit();
}
if($conn)
{
$from = From_SQL($send[1]);
$where = Where_SQL($send);
$sql="SELECT sujeto.Código FROM ".$from." WHERE ".$where.';';
$row=odbc_exec($conn, $sql);
$codigos=array();
$i=1;
while( $valor = odbc_fetch_array($row))
{
$codigos[$i]=$valor['Código'];
$i++;
}
}
return $codigos;
//debe ser de sistema no de usuario
$usuario = "";
$clave="";
//realizamos la conexion mediante odbc
$conn=odbc_connect($dsn, $usuario, $clave) or die (odbc_errormsg());;
if (!$conn) {
print "<p>Imposible conectarse con la base de datos.</p>";
exit();
}
if($conn)
{
$from = From_SQL($send[1]);
$where = Where_SQL($send);
$sql="SELECT sujeto.Código FROM ".$from." WHERE ".$where.';';
$row=odbc_exec($conn, $sql);
$codigos=array();
$i=1;
while( $valor = odbc_fetch_array($row))
{
$codigos[$i]=$valor['Código'];
$i++;
}
}
return $codigos;
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)