Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote Views
Message
De
20/03/2001 20:01:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00487071
Message ID:
00487080
Vues:
9
Hello.

So, when the user select the fields, you want to create an updatable view and store in the database. Then you want to modify it on the fly, but you don't want to add records to database.

Question: if one user modify the view, what other users will do? will use the same view or they'll modify the first users' view, altering the results it expects?

My suggestion is to create a view for every user. When the user selects the fields, you have to create the view against the one existing in the database already (avoindind, in this way, to add new views to the database). The sintax should be:
CREATE SQL VIEW user_name_view REMOTE CONNECTION connection_name ;
AS SELECT field1 [,field2 ... fieldN] FROM desired_table
Every time the above code will run, it will overwrite the previous code. But is not enough: there are something more you should do: to set a key field:
DBSETPROP("user_name_view.field1","Field","KeyField",.T.)
Then, you'll have to set the Updatable property:
FOR i = 1 to FCOUNT()
  lcField = "user_name_view."+FIELD(i)
  DBSETPROP(&lcField,"Field","Updatable",.T.)
ENFOR
And finally, Send SQL Updates:
DBSETPROP("user_name_view","View","SendUpdates",.T.)
In this way, every user will have his own view to dig the data. The view will be updatable and will have the desired fields.

What I want to highlight: there is nothing you can do with View Designer that can't be done in code.

Hope this helps
Grigore Dolghin
Class Software.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform