Taking what Frank said in combination with your comments, Fred, and it makes
better sense. 

When we get our first results, we index the file with multiple tags but a
single CDX file. When we issue the sub-query of the data in that file, it
must be creating a "virtual cursor" of the original data so when I go to
create the index on the sub-query, it throws a read-only error because we
have now created more than one CDX file for the original cursor. 

It works now by forcing the sub-query to be READWRITE which I assume is
similar to the NOFILTER option in that it creates a physical cursor rather
than a virtual one. 

I'm just speculating here because I really don't know, but at least this
theory fits the facts. :)


-----Original Message-----
From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Fred
Sent: Monday, April 09, 2018 12:40 PM
To: profoxt...@leafe.com
Subject: Re: .tmp Is Read-Only

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.


On Mon, Apr 9, 2018 at 10:35 AM, Frank Cazabon <frank.caza...@gmail.com>

> 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-boun...@leafe.com] On Behalf Of 
>> Paul H.
>> Tarver
>> Sent: Monday, April 09, 2018 11:47 AM
>> To: profoxt...@leafe.com
>> Subject: .tmp Is Read-Only
>> I think this is a two part question for VFP9:
>> 1)      Has anyone had any experience with getting a program error at
>> runtime 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, 
>> 2)      Why does VFP continue to create cursor temp files in the
>> aforementioned 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]

Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to