PHP Classes

Insert, update & delete into/from Visual FoxPro DBF with CDX

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Insert, update & delete into/from...  
Subject:Insert, update & delete into/from...
Summary:when I make inserts / deletes index exploits
Messages:3
Author:Diego Turriaga
Date:2010-04-09 04:02:58
Update:2010-04-09 17:51:36
 

  1. Insert, update & delete into/from...   Reply   Report abuse  
Picture of Diego Turriaga Diego Turriaga - 2010-04-09 04:55:01
Hi! First that all sorry for my english...

- I have a server with Windows Server 2003 installed
- I'm using php v5.2.13
- I'm connecting to VFP DBF Free Tables DB using ODBC VFP6 drivers. I try with VFP OLEDB 9 driver using COM but an error say me that it isnt installed... but this is other problem.

My real problem is that when I update the content of any dbf file (data is saved correctly) the cdx index crash (I dont know explain correcty this in english... CDX files are not afected by inserts or deletes)... and any future select, updete or delete action that afects this registry cant be done without reindex the dbf file previusly.

I try to to link cdx file to Microsoft Access MDB file and use this file in my ODBC but works very slowly and Error continues...

żany idea?

Here is a partial code:

...
$nroTalon = $talonPago->Numero();
$precio = $comision->Precio();
$codcon = $comision->Curso()->Concepto();
$insert = "INSERT INTO activida VALUES 'IDIO','$alumno','$docume','$nroTalon',$ahora,'$codcon',0,$precio)";
$conVFP->Ejecutar($insert);
if ($conVFP->Error()) {
return false;
}
...

And this is my VFP class code:

public function Ejecutar($consulta) {
$this->conexion = @odbc_connect($this->DSN, $this->usuario, $this->clave);
...
$result = @odbc_exec($this->conexion, $consulta);
$this->error = ($result==false);
$i = 0;
$this->recordset = array();
if (!$this->error) {
$fila = @odbc_fetch_array($result);
while ($fila) {
foreach ($fila as $clave => $valor) {
$this->recordset[$i][$clave] = $valor;
}
$i++;
$fila = @odbc_fetch_array($result);
}
}
...
}

There are 2 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.