Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a Cursor in a FrmDataManagerFormCustom
Message
From
22/06/2005 17:20:03
 
 
To
22/06/2005 15:14:35
General information
Forum:
Visual FoxPro
Category:
CodeMine
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01024357
Message ID:
01025618
Views:
22
Oh I have used the Help alot. I just have not looked to see if the LSQLPT is in it. I will look at your CDE and see if I can do it. When you set the cWorkArea of the CDE would that be like my GRP? TIA

>>I have Many tables that have the exact same structure and I wanted to use the same form for data entry and edit and all I wanted to do was create a different cursor depending upon which data I wanted to look at and use the same form.
>
>All you need to do is create a CDE with a single cursor object. In the CDE's BeforeOpenAll event, you could just set the cSource, cWorkArea and cDatabase properties of the cursor object to whatever table you want to open on that occasion. So, the form can always reference the work area alias you specify in the cWorkArea property, but you simply point to a different table/database by changing the values of cSource/cDatabase.
>
>>I will try the return dodefault() in the form load method. I did not put a thing in there since I >just created the form and was trying the addcursor method in the afterload of the form.
>
>If you have not subclassed the form's Load event in anyway, then there is no need to call DODEFAULT(). You only need to do this if you add your own custom code in a method that has parent class code that needs to be called. However, there is not a single reason why the AfterLoad should not fire, unless you have subclassed the Load event.
>
>>I have not looked at the CodeMine Help but are these described in it? Are there any examples to be had?
>
>If you have never looked in the Codemine help, then I suggest you do. Unfortunately, the Codemine help lacks "example" code although as a reference, it is OK. I can help you set up an LSQLPT cursor but, I would suggest you consider my suggestion above, which should allow you to achieve the desired result.
>
>>Thank you for your time and trouble.
>
>No problem.
>
>Best
>
>-=Gary
>
>PS: No wasted bandwidth here, Shakespear <s>.
>
>
>
>
>
>
>>
>>
>>>Hi Terry,
>>>
>>>>And I tried this in the form's AfterLoad(). The Set Step never executed so I am believing that the form's AfterLoad() is not executing. Any ideas?
>>>
>>>If the form's AfterLoad hook doesn't fire, that can only mean that you have code in the form's Load event method and have not called RETURN DODEFAULT(). The AfterLoad hook is called by the form's Load method, unless the inheritance chain is broken.
>>>
>>>I have monitored this thread and note that Ivan has give you advice about the AddCursor method. However, what you are doing seems in-appropriate for a "standard" Codemine application. Most of the time, cursors are defined in the CDE and opened by the CDE's OpenAll() method when the CDE is instantiated. If you want to query an existing cursor "on the fly" that is already in the Codemine CDE, then you can create a cursor object based on the LSQLPT (Local SQL passthru) cursor type. In this way, you can simply call requery on the cursor whenever you like. Also, this will be a managed cursor object because it is defined in the CDE at design time. An LSQPT cursor is a little like a standard in-line SQL select statement except that it is defined in a cursor object. I use these all the time for local data manipulation.
>>>
>>>If you could explain what you are doing with a little more clarity, I will be glad to advise you.
>>>
>>>Best
>>>
>>>-=Gary
>>>
>>>PS: No wasted bandwidth here, Shakespear <s>.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform