Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using progress bar for sql select accessing multiple tab
Message
From
01/02/2006 13:29:48
 
 
To
01/02/2006 11:02:49
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01092373
Message ID:
01092452
Views:
18
>Here's the problem I'm having, I've created a class called "progressbar" to use for select statements that take a minute or two to complete in order to display a nicer graphical bar than the default one when SET TALK is ON. When selecting data from just one table it works fine. This is how it works:
>
>pbar = newobject("progressbar")
>pbar.max = reccount('TABLE1')
>pbar.show()
>SELECT * FROM TABLE1 WHERE PBAR.UPDATE(RECNO()) ...
>release pbar
>
>The problem is when I use this statement:
>
>SELECT TABLE1.field, TABLE2.field from TABLE1,TABLE2 ;
>WHERE pbar.update(recno()) AND conditions...
>
>I've tried replacing RECNO() with RECNO('TABLE1') and RECNO('TABLE2')
>Still all that happens is the progress bar pops up, sits there, and then disappears without incrementing with all the records.
>
>How can I get around this? Is there an easier way to replace the default progress bar that Fox Pro uses when SET TALK is ON?

As you've discovered (and it's documented) you can't use RECNO() when more than 1 table is involved in a SQL SELECT statement. You should be able to get around this just by decalring a variable before your SELECT and incrementing it in your routine.
PRIVATE m.nProgress
m.nProgress = 0
SELECT TABLE1.field, TABLE2.field from TABLE1,TABLE2 ;
 WHERE pbar.update(@m.nProgress) AND conditions...
and in your pbar.update you'd use just a simple:
m.nPassedParam = m.nPassedParam + 1
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform