|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-05-21 01:43 UTC] diegoturriaga at yahoo dot com dot ar
Description: ------------ I thought it might be a matter of server version so initially I started a report here (http://www.apachelounge.com/viewtopic.php?p=15696) which will be of help to avoid writing both. Test script: --------------- In the previous url I have posted some php code... You can use a connection string like this for testing: $cnStr = 'Provider=VFPOLEDB.1;Data Source="\\server\data";Mode=ReadWrite|Share Deny None;Password="";Collating Sequence=SPANISH;DELETED=False'; Other variables needed: $charPage = CP_UTF8; $consulta = "SELECT * FROM hugedbf1 x INNER JOIN hugedbf2 y ON x.Id=y.xId" And it's all... works fine for a few records but crash for many. As I said in the other post, works fine with PHP 5.2 Expected result: ---------------- array results Actual result: -------------- php5ts.dll crash PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
<?php $charPage = CP_UTF8; $stringDeConexion = 'Provider=VFPOLEDB.1;Data Source="\\server\data";Mode=ReadWrite|Share Deny None;Password="";Collating Sequence=SPANISH;DELETED=False'; $cantRegAfectados = -1; $consulta = 'SELECT * FROM hugedbf1 x INNER JOIN hugedbf2 y ON x.Id=y.xId'; $conexion = null; $rs = null; $comando = null; # intenta crear el objeto y conectarse try { $conexion = new COM("ADODB.Connection", null, $charPage); $conexion->ConnectionTimeout = 1200; $conexion->CommandTimeout = 2400; $conexion->Open($stringDeConexion); } catch (Exception $e) { echo "Error creando conexion OLEDB.<br/><br/>". $e->getMessage(); exit(1); } # intenta crear un comando try { $comando = new COM("ADODB.Command"); $comando->CommandType = 1; //adCmdText $comando->ActiveConnection = $conexion; $comando->CommandText = $consulta; } catch (Exception $e) { echo "Error creando el comando OLEDB.<br/><br/>". $e->getMessage(); exit(1); } # intenta ejecutar el comando SQL try { $rs = $comando->Execute($cantRegAfectados); } catch (Exception $e) { echo "Error ejecutando comando OLEDB.<br/><br/>". $e->getMessage(); exit(1); } # pasa los datos al recordset y libera los recursos $this->recordset = array(); $j=0; if ($rs->State!=0) { while (!$rs->EOF) { for ($i=0; $i<$rs->Fields()->Count; $i++) { $this->recordset[$j][$rs[$i]->Name] = $rs[$i]->Value; } $rs->MoveNext(); $j++; } $rs->Close(); } $conexion->Close(); $rs = null; $conexion = null; echo "It's all right!"; return 0; ?> PD: You will need hugedbf1.dbf and hugedbf2.dbf shared on \\server\data and the user running apache service need permission from I/O there. Also you have to have installed the VFP OLEDB drivers.