Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Just wondering: Two views or one?
Message
 
 
To
02/02/2001 15:01:14
Jill Derickson
Software Specialties
Saipan, CNMI
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00471454
Message ID:
00471993
Views:
18
No, I just have the 1 view. I use SPT/SQL command to create the cursor used to select from. I have an INQUIRY form where users enter selection criteria for major fields like last name, city, permit number, etc. I then build the SQL command from the info they entered -- SELECT ... INTO CURSOR crsRESULTS. This cursor then becomes the record source of a grid. They select a record and click OK button which sends them to an editing form that uses a parameterized view based on the KeyID of the select record in the SQL results form.

If the do another INQUIRY, I build a new SQL command and execute the SELECT ... INTO CURSOR crsRESULTS just as before. If the user changes the parameter, you really have no other choice but to issue another query. Remember, a view is just a stored SQL command. I am actually doing less than what VFP does in opening a view. I only select the records. I do not make the cursor updatable or set any other view properties.

>Hi Mark,
>
>Thanks for your input.
>
>: Since your view probably has all the fields that are being updated on page 2, I would say 1 view.
>yep, it does.
>
>: I usually have 1 cursor and 1 view.
>
>:The first view is the pick list and is not updatable and has a limited number of fields
>
>: I allow my users to input values for specific fields then build a query to select the matching records into a cursor.
>
>:The value of this property is used in the child form [in the activate method] to REQUERY() the view which, of course, will contain exactly one record.
>
>
>Sounds like a great idea...thanks...I'm a tiny bit confused about the "1 view" - do you mean 2 views (the not updateable pick list, and the updateable view w/1 entry) and 1 cursor (that displays the records).
>
>The reason I'm wanting to be clear on that is because of the original problem that caused me to rethink how I do this:
>
>>Right now, when changes are made on the second page, the view on the first page is REQUERYed (i'd previously looked into using the VIEW REFRESH() function, that "updates one or more records in a view with the current data from the original data source", but had trouble).
>
>It seems like a lot of network traffic to REQUERY the entire view on the first page, everytime there is a change in an entry. What do you do? when there is a change, do you REQUERY the pick list? or do a REFRESH() on the view - as I said, I've had trouble getting this to work - supposedly "REFRESH() updates one or more records in a view with the current data from the original data source. " I seem to need to do a REQUERY on the entire view in order to see the changed data.
>
>J
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform