查询进度条问题
表单上有一个按钮,按钮的click事件为一个sele查询语句,内容为
select * from a where AT(alltrim(b.品名),a.品名)> 0 and AT(alltrim(b.产地),a.产地)> 0
请问如何在运行查询的时候,显示查询进度(用进度条控件的那种)
[解决办法]
SET TALK OFF
cTable = GETFILE( "dbf ")
IF EMPTY(cTable)
RETURN .T.
ENDIF
SELECT * FROM (cTable) WHERE Progress_Bar( RECNO()*100/RECCOUNT(), "Processing ... "+STR(RECNO()*100/RECCOUNT())+ "% " )
SET MESSAGE TO
CLOSE ALL
RELEASE ALL
* *************************************************************************
PROCEDURE progress_bar
LPARAMETERS tnUpdateValue, tcTitle
IF INT(tnUpdateValue) > = 1
IF TYPE( "oThre " ) <> "O "
PUBLIC oThre
oThre = CREATEOBJECT( "frmProgress ")
oThre.Show( )
ENDIF
oThre.ShowThre( tnUpdateValue, tcTitle )
IF INT( tnUpdateValue ) > = 100
= MESSAGEBOX( "Finished! ", 64, "Info " )
RELEASE oThre
ENDIF
ENDIF
ENDPROC
* ***********************************************
DEFINE CLASS frmprogress AS FORM
DoCreate = .T.
ShowTips = .T.
AutoCenter = .T.
Caption = " "
ControlBox = .F.
Closable = .F.
MaxButton = .F.
MinButton = .F.
Movable = .F.
Height = 72
Width = 350
BorderStyle = 2
WindowType = 0
Name = "frmProgress "
ADD OBJECT line1 AS line WITH ;
BorderWidth = 2, ;
Height = 0, ;
Left = -1, ;
Top = 1, ;
Width = 348, ;
BorderColor = RGB(128,128,128), ;
ZOrderSet = 0, ;
Name = "Line1 "
ADD OBJECT labthre AS label WITH ;
Alignment = 2, ;
Caption = " ", ;
Height = 17, ;
Left = 48, ;
Top = 12, ;
Width = 288, ;
ZOrderSet = 1, ;
Name = "labThre "
ADD OBJECT line2 AS line WITH ;
BorderWidth = 2, ;
Height = 0, ;
Left = 2, ;
Top = 71, ;
Width = 346, ;
BorderColor = RGB(255,255,255), ;
ZOrderSet = 2, ;
Name = "Line2 "
ADD OBJECT line3 AS line WITH ;
BorderWidth = 2, ;
Height = 68, ;
Left = 1, ;
Top = 1, ;
Width = 0, ;
BorderColor = RGB(128,128,128), ;
ZOrderSet = 3, ;
Name = "Line3 "
ADD OBJECT line4 AS line WITH ;
BorderWidth = 2, ;
Height = 68, ;
Left = 349, ;
Top = 2, ;
Width = 0, ;
BorderColor = RGB(255,255,255), ;
ZOrderSet = 4, ;
Name = "Line4 "
ADD OBJECT image1 AS image WITH ;
Picture = "progress.bmp ", ;
BackStyle = 0, ;
Height = 32, ;
Left = 7, ;
Top = 7, ;
Width = 32, ;
ZOrderSet = 5, ;
Name = "Image1 "
ADD OBJECT olethre AS OleControl WITH ;
OleClass = "MSComctlLib.ProgCtrl.2 ", ;
Top = 45, ;
Left = 14, ;
Height = 13, ;
Width = 326, ;
ZOrderSet = 6, ;
Name = "oleThre "
ADD OBJECT line5 AS line WITH ;
Height = 0, ;
Left = 9, ;
Top = 61, ;
Width = 333, ;
BorderColor = RGB(255,255,255), ;
ZOrderSet = 7, ;
Name = "Line5 "
ADD OBJECT line7 AS line WITH ;
Height = 0, ;
Left = 9, ;
Top = 41, ;
Width = 333, ;
BorderColor = RGB(128,128,128), ;
ZOrderSet = 8, ;
Name = "Line7 "
ADD OBJECT line8 AS line WITH ;
Height = 19, ;
Left = 9, ;
Top = 42, ;
Width = 0, ;
BorderColor = RGB(128,128,128), ;
ZOrderSet = 9, ;
Name = "Line8 "
ADD OBJECT line6 AS line WITH ;
Height = 19, ;
Left = 341, ;
Top = 42, ;
Width = 0, ;
BorderColor = RGB(255,255,255), ;
ZOrderSet = 10, ;
Name = "Line6 "
*-- Used to show the thremeter progress
PROCEDURE showthre
LPARAMETERS tnProgress, tcTitle
LOCAL lnProgress, lcTitle
lnProgress = INT(tnProgress)
IF PARAMETERS()=2
lcTitle = tcTitle
ELSE
lcTitle = " "
ENDIF
WITH thisform
.LockScreen = .T.
.labThre.Caption=lcTitle
.oleThre.Value=lnProgress
.LockScreen = .F.
ENDWITH
ENDPROC
ENDDEFINE