Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with cursor names in VFP 9
Message
 
 
To
11/10/2005 16:38:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01057970
Message ID:
01058092
Views:
19
There has been a behavior change between VFP 6 and VFP 9 which handles cursors slightly differently, and I think is causing my problem. In VFP 6 cursor files were created in 8.3 format. That is no longer the case. I am seeing file names in 13.3 format, e.g. 00002m89000cz.tmp (or .cdx if the cursor gets indexed). Furthermore, I see from tracing this particular process that the first 8 characters of different cursor file names -- of which this process has six open at the point where it is acting weird -- are non-unique. So there are other cursors named 00002m89000p2.tmp, 00002m89000t2.tmp, etc.

I think what is happening is VFP 9 is getting these files mixed up. I am seeing VERY odd behavior while debugging this. One time through it will say one cursor (alias) is not found. The next time maybe it works okay. Then it says a different cursor is not found. One time I flipped over to the VFP window and switched work areas to browse one of the cursors. After doing that, reselecting the previously selected work area, and going back to the debugger window, I quickly got an error saying a cursor that was not involved in any of this, one created much earlier, was not found.

I may have to do what you did, using tables instead of cursors, but hope it doesn't come to that. This application has cursors up the ying-yang so it would be a lot of code changes and testing. Making matters worse, it runs most of the time with error handling turned off (see no evil, hear no evil, speak no evil....) so problems often don't show up until later -- the program just continues on its merry way before failing somewhere else.

Do you happen to know if there is a way to make VFP 9 create cursor files in 8.3 format?

Thanks to all who have been helping!

Mike



>I am seeing something similar. If I do something like:
>
>1. TableA contains the records I select from.
>2. TableB is a new empty cursor I create using a select statement.
>3. TableC is a table I want to append records INTO from TableB
>
>1. Select * from tableA into cursor Temp1 (this creates the file 00005IBT0008.tmp in my TMPfiles directory and the table Temp1 is in use.
>2. Determine the filenane for the temporary cursor. (TableB)
>3. Open a new empty table in an open workarea (TableC)
>4. Attempt to append into TableC from TableB.
>
>I receive the error message: "File is in use."
>Since I created a cursor, not a table, if I close the cursor, then it no longer exists. It works if I create a table for TableB instead of a cursor and then delete the table when I am done and just step through tableB and write the records to TableC from either a table or the query results instead of using APPEND. That is what I typically do. I seldom use append unless the table physically exists on the harddisk and is a permanent table for the app or a file that is downloaded, etc.
>
>
>>I am moving a VFP 6 app to VFP 9 and running into problems with cursors. This happens with both kinds of cursors, the kind created by SELECT INTO CURSOR as well as CREATE CURSOR. These cursors are being created in the C:\Documents and Settings\username\Local Settings\Temp folder and have names such as 00002m8900cz.tmp. This application frequently creates cursors and then appends to real tables with APPEND FROM (lcDBF), where lcDBF is the saved DBF() name of the cursor. APPEND FROM is not working correctly, I believe because it does not like filenames starting with numeric characters. What can I do to get around this?
>>
>>Not sure exactly when this broke -- could be VFP 7, 8, or 9.
>>
>>Thanks in advance!
>>
>>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform