You're SQL cursor has to be made with the READWRITE clause if you're going to try to create more than one index on the resulting cursor.
Fred
On Mon, Apr 9, 2018 at 10:35 AM, Frank Cazabon frank.cazabon@gmail.com wrote:
Paul,
this is probably due to VFP's optimisation. Always get in the habit of using NOFILTER as part of your SQL SELECT command.
Try it and see if it works in both scenarios for you.
Without the NOFILTER, VFP may optimise the query by just opening the cursor again with a filter applied, this may then cause problems while indexing. My guess is that it optimises it slightly differently in the development environment so it works in that case, but in the runtime it handles it by just filtering it.
Frank.
Frank Cazabon
On 09/04/2018 01:07 PM, Paul H. Tarver wrote:
Further testing has revealed a couple of things, but I still don't understand the why.
The error is generating when I attempt to index the results of a query made against SQL query resultant cursor. So, here's the logic: First, I send a SQL Pass-through query to the server and store the large number of results in TableA. Then when working on just a portion of the table I issue a VFP like Select * from TableA where condition into cursor TableB. Then I try to create a CDX file with three indexes for TableB. In the development environment this works perfectly. However, once compiled, I get the error that I noted in the previous message.
Interestingly, if I change the VFP query to Select * from TableA where condition into cursor TableB READWRITE, then everything works perfectly in both the development and compiled versions of the program.
Can anyone explain the why? I'm sure it has to do with the difference between querying a cursor I made in the program versus querying a cursor created from a SQL Pass-Through query. But what I can't understand is that I am creating indexes on the results of the SQL Pass-Through query before I ever create a sub-query of that data, so it leaves me confused as to why the read-write permissions are difference between the development and compiled versions of my program.
Paul
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul H. Tarver Sent: Monday, April 09, 2018 11:47 AM To: profoxtech@leafe.com Subject: .tmp Is Read-Only
I think this is a two part question for VFP9:
Has anyone had any experience with getting a program error atruntime like this: File c:\users\paul\appdata\local\te mp\xxxxxxxxxxxxxxx.tmp is read-only? I do not get a similar error when running in development mode and I have explicitly set SORTWORK, PROGWORK, EDITWORK and TMPFILES in the CONFIG.FPW file.
Why does VFP continue to create cursor temp files in theaforementioned path at all when I've manual set the path for temporary files in the CONFIG.FPW file?
I'm sure it is something I'm doing wrong, so feel free to provide constructive OR destructive criticism. J
Thanks!
Paul
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]