I’m trying to work with some simple DBF files within ColdFusion. I’ve set up a System DSN in Windows using the dBase driver and have successfully set up the datasource in ColdFusion Administrator. I can do the usual SQL queries against the datasource with no issues.
I’ve left the “show deleted rows” on in the DSN configuration. (The obvious answer is to change that setting, but for now let’s pretend that I can’t.)
How, then, do I exclude rows marked as deleted in my queries? From information elsewhere, in FoxPro for instance, you’d use the DELETED() function to find those rows. However, if I use that function in my CF query I get
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC dBase Driver] Undefined function ‘deleted’ in expression.
I’ve tried these two techniques:
SELECT ID, fName, lName, deleted() AS isDeleted
FROM myTable
SELECT ID, fName, lName
FROM myTable
WHERE NOT deleted('myTable')
Is there another way to do it that’ll work with ColdFusion? Or is the driver setting my only hope?
As far as I know, none of the dBase ODBC drivers supports
deleted()orSET DELETED ON | OFF. While changing the setting in the driver configuration would be the best bet, you could also try to use a FoxPro ODBC driver, which should support the deleted() function.You can also PACK your dBase table, to get rid of your deleted records.