Reputation: 391
I have database with DBF format, and use the ODBC to access the database. When i do update on the table, it returns error:
Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC dBase Driver] Index not found., SQL state S0012 in SQLExecute in C:\xampp\htdocs\payroll\index.php on line 16
According to the error msg, it seems like the index not found. what index is that? how to fix? Below is the PHP script that i use to do the query.
$odbc = odbc_connect ('payroll', '', '') or die('Error connecting to server. Server says: '.odbc_errormsg());
$upd_q = "UPDATE paytran SET empno = 22 WHERE empno = 888";
$update = odbc_prepare($odbc, $upd_q);
$result = odbc_execute($update);
odbc_close($odbc);
Same method was used to insert new record. Insert query works successfully, but not for DELETE and UPDATE query.
Upvotes: 1
Views: 1354
Reputation: 8327
According to the last post in this thread,
If you have a .dbf file nowadays, more often than not, it is from a FoxPro application. And, since you have a .cdx file, that tells you it is a FoxPro compound index file and dBASE can't use it and certainly can't take advantage of it to get any speed advantage that you would like in your queries.
Do you have a .cdx
file? If so, you may want to check which version you have and then find the FoxPro driver or OLE DB provider, and use that instead of ODBC. There's information on how to do it here and here; the driver and DB provider are here.
Upvotes: 2