Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to replace VFP cursors
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01520206
Message ID:
01520208
Views:
86
>>I'm looking for a way to speed up a calculation routine that computes the total of a document that can contain up to a few hundred lines. The routine is slow now because for each line I access the db. I'm looking for a way to implement this in a more data oriented way.
>>
>>In VFP I would have dumped the relevant keys into a cursor and then join the tables to the cursor in an sql statement.
>>
>>I could of course simulate this by dumping the keys into a temporary table (which if I'm right would not limit the amount of times I access the db), but I was wondering if there is not a more "elegant" way to do this.
>>
>>TIA.
>
>I'm not sure I understand you right, but you could use derived tables in your SELECT.
>
>SELECT .....
>FROM MainTable
>INNER JOIN (SELECT Keys From SomeTable WHERE ...) DympedKeys
>   ON ....
>
Right Borislav, I'm sorry, I was not explicit. I'm not working in VFP, but in vb.net. And my keys are for the time being stored in some sort of datatable in memory.
The problem of speed is relevant because I need to recompute the totals each time the user enters or changes a field in the document.

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform