Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select * from ... into cursor
Message
From
29/07/2009 09:47:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01414879
Message ID:
01415308
Views:
76
>Maybe I am confusing cursor.name with cursor.alias
>
>Can I rename the alias of a created cursor, as I do with visual cursors in DE ?

A cursor object in the DE is... well, just a holder for the actual cursor (as in "CURrent Set Of Records"), and it has a few PEMs to handle the actual cursor. As an object, yes it has a .name etc, but that doesn't change the alias of its actual cursor.

The old trick to

use dbf("tempalias") again alias "thealiasyouwant"

still works, no problem there. To avoid the problem you have, you can select from your original tables under a different alias, close the original, rename the cursor... like this: suppose you have a textbox with controlsource thealiasyouwant.somefield, and you can't have a cursor with alias "thealiasyouwant"... I've found this to work (which you already saw posted by others):
SELECT * FROM thealiasyouwant INTO CURSOR  tempalias NOFILTER READWRITE 
USE IN thealiasyouwant 
USE DBF("tempalias") AGAIN ALIAS thealiasyouwant IN 0
use in select("tempalias")     && this is optional - you may have reasons to keep it open.
Then you wouldn't have to change the aliases in code.

But then you have a different problem - how will you save the changes into the dbf with the same name? That's actually simple - now that you've created your cursor with the alias same as the original table's name, now you can reopen that table... under a different alias, pretty much anything you may want except its actual name. Reads like a spy novel, but, hey, beats changing aliases in the whole app, right? :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform