>I have quite a large application (VFP8 front-end, SQL-server back-end) in which I now find I require to use alternative databases for some forms, but only for some clients. Up to now many remote-view cursors have been dragged from the database designer into the form DE, but that brings with it a hard-coded path to the database container the view was dragged from. As far as I can see, if an alternative dbc is required I will have to change the .database property of each cursor at runtime, but I think a neater way will be to open each view explicitly in form.load(), preceded by SET DATABASE TO (MyDBC).
>
>Apart from losing the 'visual' aspect of viewing tables/cursors in the form DE at design-time, are there any other disadvantages of opening cursors manually in form.load()? I can still set indexes, relations, etc. in code, but I want to make sure I don't miss anything before I make this change to many forms.
>
>TIA,
>Alan
You might miss milliseconds which is not a big deal.
Compared to SQLExec(), RV's already make it more 'visual' and I wouldn't sacrifice DE for this (and that might lead to unintentional errors - ie: set database is not a safe way to make it, Check recent threads about it).
Instead of manually coding it all in load just to change database, you might as well do it in DE.BeforeOpentables. Check for sample code with eywords 'BeforeOpenTables,amembers,cursorsource'.
Basically what you do is to call an external routine from form.DE.BeforeOpenTables. That routine loops all cursor members and sets correct database,cursorsource based on oApp.properties.
Cetin