Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine If A Cursor Is A View
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01296168
Message ID:
01296191
Views:
14
This message has been marked as the solution to the initial question of the thread.
>>>>>I have a form opened as a table. I'm looking at Cursors in the DE, and I'm wondering how do you know, by looking at
>>>>>the Properties column, if a cursor in the DE is a view or a table?
>>>>
>>>>Name it, just add lvSomeName or rvSomeName.
>>>
>>>I don't think you understand. I am looking at the records for cursors in a form's SCX. I have the form open as a
>>>table with USE.
>>>
>>>For records that represent Cursor's or Views, the Class and BaseClass columns show 'Cursor'. How do you know
>>>if it represents a DBF or a view in the DBC?
>>
>>As I said Name your Views accordingly and you should define them by Name.
>>I am not sure if there are any properties that you could use to define them. Maybe only Exclusive is ALWAYS = .t. for Views. So if any other tables are opened in shared mode only Views will have Exclusive=.t.?
>
>These forms are already in production. I'm not creating them. I'm trying to find a way to determine if it's a cursor or a view.

How about something like this (NOT TESTED AT ALL)
OPEN DATABASE YourDataBase
ADBOBJECTS(laViews, [VIEW])
USE YourForm.SCX
SET FILTER TO BaseClass == [Cursor] AND ASCAN(laViews,ALLTRIM(STREXTRACT(Properties,[CursorSource = "],["],1),1,-1,1,1) # 0
UPDATE CursorSource is part of Properties Field


Update AGAIN:
That worked here:
OPEN DATABASE Tables\InternalFiles
ADBOBJECTS(laViews, [VIEW])
USE Tte.SCX
SET FILTER TO UPPER(ALLTRIM(BaseClass)) == [CURSOR] AND ASCAN(laViews,ALLTRIM(STREXTRACT(Properties,[CursorSource = "],["],1)),1,-1,1,1) # 0
BROWSE NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform