Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote View
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00271293
Message ID:
00271760
Vues:
16
>>>I want to create a remote view to do something like this:
>>>
>>>SELECT [field list] FROM [table] WHERE ?cExpression = .t.
>>>
>>>I want to build cExpression on the fly, then re-query the view. For example, the user can enter values and I build an expression that says cName = 'First Bank' and cState = 'TX', then re-query the view. Or someone else might want to query with cPhone = '555-1212'. This way the users would have the most flexibility in selecting the records they want to work with. I could even add something like StoneField Query to give the users a user friendly interface for building the expression.
>>>
>>>My question is: CAN THIS BE DONE?
>>>
>>>I have tried several different methods and either the view will not be created or when I try to open the view, I get an syntax error.
>>
>>Dan,
>>
>>There was an article in Fox Advisor about this several months ago. Basically you need to redefine the view in the DBC before you do the requery. You can build the view initially as...
>>
>>SELECT Fields FROM Tables WHERE .t.
>>
>>Then, build your select on the fly and recreate the view with the CREATE VIEW command. Of course, this will requre each user to have a private .DBC, but that is generally recomended anyway.
>>
>>BOb
>
>Why mess with a view for this? If it's back end data why not do SQLExecute() to pass this dynamic data request?
>
>Have the user fill in data requests from a find page/form and that builds the where content. Sounds easy but it will take some time to get polished.

Well... if you want to allow the user to update the data... a view makes things easier.

Another method I have used is to create a view with no WHERE clause that is updateable and open it NODATAONLOAD... Then, use SPT to get a recordset, put the data into the view and use SETFLDSTATE to clean the buffer... Now, allow the user to edit is and a simple TABLEUPDATE() writes all the changes to the back end.

BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform