Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which is more practical, cursor adapter or SQL passthrou
Message
From
24/05/2012 11:07:45
Walter Meester
HoogkarspelNetherlands
 
 
To
24/05/2012 09:16:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01543874
Message ID:
01544284
Views:
55
Hi Alex,

I would if it was not so much embedded into the larger framework which I can't possibly publish here.


Walter,


>>Hi Alejandro,
>>
>>SPT is good for doing some quick and dirty database access. But when you start updating tables, you seriously need to consider using cursoradapters.
>>
>>We have created a some biz objects for the dataobjects layer which allow you to create cursor adapter views at runtime. Those are based upon classes that automatically handle things for you, like:
>>- Converting datetimes to dates, just like remote views
>>- Empty dates (the VFP empty) date if they are below 1910/01/01or NULL on the SQL database.
>>- Write changes to an audit trail
>>- Does do data validation before saving.
>>
>>The nice thing is that it all is directly compatible with the known VFP functions like REQUERY(), REFRESH(), TABLEUPDATE(), TABLEREVERT(), AERROR(), just like it was with remote views, but you have additional power to hook into those functions when they are executed upon a cursoradapter.
>>
>>We switched from remote views and SPT a few years ago, and regret we did not do that as soon as VFP8 came out. We got rid of hundreds of remote views on a included database and now create them in the fly through a metadata table. In our case we create a view through the following code
>>
>>
oDh.MakeView(cSql, cAlias, cSchema, cUpdateInfo, nBuffermode, lnoData)
>>
>>Unlike remote views, you can use SELECT * in a SQL command. cSchema is optional and can describe only the exceptions rather than the full list (handy if you only want to translate datetimes to dates. cUpdateInfo is also optional and can use * to define that all fields need to be updated.
>>
>>This gave us so much power that handling remote data has become so much easier it has increased the scalability, flexibility, robustness and productivity.
>>
>>So in short, if you are looking for something quick and dirty, you might go for SPT. In all other cases, I'd definately go for CA.
>>
>>Walter,
>
>Thank you very much Walter. Sounds like you have it under control. Would it be too much to ask you to consider sharing some of those classes?
>
>Thanks,
>
>Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform