Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REQUERY in a grid too slow
Message
From
13/12/2005 11:44:59
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
13/12/2005 11:13:12
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01077521
Message ID:
01077528
Views:
24
Hi John

If you are requerying the views after the user has entered data, just to refresh the controls, you can play a little trick. Assuming the data was entered and tableupdated...

local llSendUpdates
llSendUpdates = cursorgetprop("SendUpdates")
cursorsetprop("SendUpdates",.F.)
replace fields with expressions in localviewname
tableupdate()
cursorsetprop("sendupdates",m.llSendUpdates)

Having a local copy of the DBC is good practice too.

>Hi,
>
>I use a local view "lvSchedule_Items" as the RecordSource of a grid. This local view is composed based on two other local views ... "lvschedule_items_a" and "lvschedule_items_0" (all local views listed below)
>
>The user is allowed to add records to the schedule_items table and I use the following Requery statements to reload the view and refresh the grid display:
>
>
>REQUERY("lvSchedule_Items_a")
>REQUERY("lvSchedule_Items_0")
>REQUERY("lvSchedule_Items")
>
>
>I find the REQUERYing and the Refreshing of the gris takes extremely long. Sometimes 25-20 seconds or more. All tables, views are defined in one database residing on a shared folder and a Windows 2003 file application sever. The users are accessing the database from several PCs on the network.
>
>Is there a way to make the REQUERYing feature quicker? Is this the right approach?
>
>
>Thanks in advance!
>John
>---------------LOCAL VIEWS ----------------------------------
>"lvSchedule_Items"
>
>SELECT Lvschedule_items_0.*, Film.ccode AS cfilmcode;
> FROM  imaflex!lvschedule_items_0 LEFT OUTER JOIN imaflex!film ;
>   ON  Lvschedule_items_0.cfilmid = Film.id
>
>
>"lvSchedule_Items_0"
>
>SELECT Lvschedule_items_a.nseqno, Lvschedule_items_a.cworkorderid,;
>  Lvschedule_items_a.cname, Lvschedule_items_a.nsize1imperial,;
>  Color_base.cname AS colorname, Lvschedule_items_a.cblendcode,;
>  Lvschedule_items_a.cfilmtype, Lvschedule_items_a.npounds,;
>  Lvschedule_items_a.nrunningrate, Lvschedule_items_a.nlayduration,;
>  Lvschedule_items_a.cjobtype, Lvschedule_items_a.ddate_promised,;
>  Lvschedule_items_a.dend_date, Lvschedule_items_a.nend_hour,;
>  Lvschedule_items_a.nend_min, Lvschedule_items_a.cdelivery,;
>  Lvschedule_items_a.nsize2imperial,;
>  Lvschedule_items_a.ccustomercolorid, Lvschedule_items_a.key,;
>  Lvschedule_items_a.id, Lvschedule_items_a.caddby,;
>  Lvschedule_items_a.taddstamp, Lvschedule_items_a.ceditby,;
>  Lvschedule_items_a.teditstamp, Lvschedule_items_a.cscheduleid,;
>  Lvschedule_items_a.cfilmid;
> FROM  imaflex!lvschedule_items_a LEFT OUTER JOIN imaflex!customer_color;
>    LEFT OUTER JOIN imaflex!color;
>    LEFT OUTER JOIN imaflex!color_base ;
>   ON  Color.ccolor_baseid = Color_base.id ;
>   ON  Customer_color.ccolorid = Color.id ;
>   ON  Lvschedule_items_a.ccustomercolorid = Customer_color.id;
> ORDER BY Lvschedule_items_a.nseqno
>
>
>"lvSchedule_Items_a"
>
>SELECT Schedule_items.nseqno, Schedule_items.cworkorderid,;
>  Customer.cname, Saleorder_items.nsize1imperial,;
>  Saleorder_items.cblendcode, Saleorder_items.cfilmtype,;
>  Schedule_items.npounds, Schedule_items.nrunningrate,;
>  Schedule_items.nlayduration, Schedule_items.cjobtype,;
>  Saleorder_items.ddate_promised, Schedule_items.dend_date,;
>  Schedule_items.nend_hour, Schedule_items.nend_min,;
>  Saleorder_items.cdelivery, Saleorder_items.nsize2imperial,;
>  Saleorder_items.ccustomercolorid, Schedule_items.key,;
>  Schedule_items.id, Schedule_items.caddby, Schedule_items.taddstamp,;
>  Schedule_items.ceditby, Schedule_items.teditstamp,;
>  Schedule_items.cscheduleid, Saleorder_items.cfilmid;
> FROM  imaflex!schedule_items LEFT OUTER JOIN imaflex!saleorder_items;
>    LEFT OUTER JOIN imaflex!saleorder;
>    LEFT OUTER JOIN imaflex!customer ;
>   ON  Saleorder.ccustomerid = Customer.id ;
>   ON  Saleorder_items.csaleorderid = Saleorder.id ;
>   ON  Schedule_items.cworkorderid = Saleorder_items.cworkorderno;
> WHERE Schedule_items.cscheduleid = ?schedule.id;
> ORDER BY Schedule_items.nseqno
>
Previous
Reply
Map
View

Click here to load this message in the networking platform