Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor Adapter with dynamic tables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01075279
Message ID:
01075802
Views:
16
>Hi everybody,
>
>First of all, what would be the best category for CA questions?
>
>We want to use CA for the free tables, whose names should change in the run-time. It would be nice to be able to build this CA class only once and use it in the DE of our business objects.
>
>What would be the best way to accomplish that?
>
>Thanks in advance.

Cursor adapters seem to be very flexible to me. For me, I like the idea of custom dataenvironments full of cursor adapters whereby the dataenvironments beforeOpenTables method has some dynamic code to 'point' the dataenvironment at the right database. But the names of the tables don't actually change in my scenario. I see the ability to switch out the data environment full of CA's pointing at free tables to one with CA's pointing at an SQL backend or something else as the big accomplishment.

But CA's are totally programmable/buildable on the fly. Use a master class in combination with metadata of the tables so you would include in the init event of the CA code to look up the passed table reference from the metadata and 'populate' the CA object appropriately. Since you are specifically targeting free tables the code should be fairly straightforward; but somewhere the details of the tables has to be available to populate the single subclassed master CA with the specific table 'sql' update commands. Otherwise, you are back to opening the table to get the information in which case you've violated the reason for needing the CA in the first place.
Steven D. Supinski
The American Contractor
Santa Cruz, CA 95062
Phone: (800) 333-8435 ext 4017
Email: ssupinski@theamericancontractor.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform