Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reposition record pointer in a BizObj
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00362006
Message ID:
00363022
Views:
21
>Cathi,
>
>>I need move to a specific record in a BizObj based on the cUniqueIdField. Is there a method to do this in the BizObj or DataBehavior? I can't seem to find one. I don't like coding record movement directly on my forms because the DataBehavior could change in the future and cause my code to error. There is methods for First, Last, Next, and Prior but not for a specific record based on the cUniqueIdField or any other field.>
>
>There is no generic method in KBizObj to locate a specific record based on UniqueID. What I recommend is this...
>
>1. Subclass KBizObj to create your own "common" or "base" business object class. Create all of your business objects as subclasses of this base business object class
>
>NOTE: If you've already created your existing business objects as direct subclasses of KBizObj you can open your business object class libraries in the Class Browser and use the "Redefine" button to change the parent class of your objects from KBizObj to your new base business object class.
>
>2. Create a new method in your base business object and name it something like "SeekRecord". For example, you could do something like this:
>
>LPARAMETERS tcUniqueID
>LOCAL lcAlias
>
>lcAlias = This.GetAlias()
>
>*--- NOTE: This only works if you have a tag named the same
>*--- as the field name stored in This.cUniqueIDField
>
>RETURN SEEK(tcUniqueID, lcAlias, This.cUniqueIDField)
>

You used the SEEK function here. I am using remote views for all data access with the back end being SQL Server. Would I be better off using the SEEK or the LOCATE function? These tables could get quite large in the future. I will almost always SEEK/LOCATE on the primary id. To use the SEEK function I assume I would need to create a temporary index when the view is created. I would think this could take a long time.

Thank you for your help.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform