> >
> >
> > You add SET DELETED in the connection by adding ;DELETED=Yes; to the string.
> > You should probably not use VFPODC at. It's not been updated sin VFP6. Today we use VFPOLEDB.DLL instead with an ADODB.Connection oobject.
> > The latest version of VFPOLEDB is version 9 and can be downloaded from Microsoft.
> >
> > -Anders
>
> Hmmm.. Thanks for the replies. I think I may be a little out of my depth with ADODB connection objects. I don't know how I'd go about setting one of those up! I have installed the VFPOLEDB from the Microsoft site.
>
> As far as I'm aware, the connection would have DELETED=Yes set already. The connection I've set up in the 'Control Panel > ODBC' has the following settings:
>
> Collating = Machine
> Exclusive = FALSE
> Null = TRUE
> Deleted = TRUE
> Fetch data in background = TRUE
>
> The connection works fine for Excel, but Access comes up with this error. I'm starting with a blank database, I don't intend to edit the data or anything, just query it so I can create presentable reports (usual stuff- sales figures etc). I assumed Access would be able to connect in a similat manner and then I could create reports based on the query.
>
> Again, thanks for the replies.
>
> Jim
Once you've SET DELETED OFF, or Deleted=Yes in the connction stgring, there's no need ever to bother with the DELETED() function anymore. Any rows marked for total deletion with the command PACK tablename, will immediately disappear from any query results or listings.
You shouls also be careful using the DELETED() function in queries: DELETED() takes an open table alias a parameter, DELETED('clients'). If left empty it takes the current workarea's alias name as implicit parameter. This can lead to totally unpredictable results for DELETED(), or DELETED('clients') as we just can't be sure what the actual 'current workarea' is during the processing of a SQL query. And VFP may very well have opened the tables of the FROM clause again with new, unknown alias names to process the SELECT command. The general recommended solution is SET DELETED OFF, and removing all DELETED() from the query.
This applies to all VFP functions that cn take a ALIAS paramter as a reference to an particular open table, when use in any SQL command.
-Anders