Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a Cursor in a FrmDataManagerFormCustom
Message
De
22/06/2005 21:37:20
 
 
À
22/06/2005 17:45:21
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01024357
Message ID:
01025675
Vues:
12
OK thanks. I will try this and get back to you. TIA.

>>When you set the cWorkArea of the CDE would that be like my GRP? TIA
>
>The CDE (Codemine Data Environment) contains cursor objects, rules objects etc., You set the cWorkarea property of a cursor object. There is a builder in the CDE that lets you create cursor objects and set their properties. If GRP is the cursor name you SELECT into, the yes, you could set the cWorkArea property of a cursor object to GRP, and set the cSource property to the actual name of the table that you want to use. Therefore, no SELECT required against the tables. Also, this way, your cursor object will facilitate changes and updates directly against the cursor whereas your selected cursor will require more work to update the original source table you are selecting from.
>
>HTH,
>
>-=Gary
>
>PS: No wasted bandwidth here, Shakespear <s>.
>
>
>
>
>
>>
>>>>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>.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform