Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Dim m As Integer
m = 0
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + Val(a) + Val(s)
m = m + 1
ProgressBar1.Value = m
Adodc1.Recordset.MoveNext
Wend
MsgBox ("sdjflkdj")
End Sub
高手看我设的value值对吗?
另外,我的意图是实现并列的5个循环的进度条,有该怎样设value值呢?
13 个解决方案
#1
'看看我的进度条 !
Sub UpdatePic(pb As Control, ByVal percent)
Dim num$ ' Used to hold percent string
If Not pb.AutoRedraw Then ' Do we have off-screen image?
pb.AutoRedraw = -1 ' No, set one up.
End If
pb.Cls ' Clear off-screen image
pb.ScaleWidth = 100 ' Set for percentage
pb.DrawMode = 10 ' Set for erasable drawing
'
' Display the percentage, centered in the picture
' box.
'
num$ = Format$(percent, "##0") + "%"
pb.CurrentX = 50 - pb.TextWidth(num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(num$)) / 2
pb.Print num$ ' Display percentage
'
' Draw box over the percentage.
'
pb.Line (0, 0)-(percent, pb.ScaleHeight), , BF
pb.Refresh ' Show changes on screen
End Sub
'---使用方法--
For i = 1 to 100
UpdatePic Picture1 , i
Next i
Sub UpdatePic(pb As Control, ByVal percent)
Dim num$ ' Used to hold percent string
If Not pb.AutoRedraw Then ' Do we have off-screen image?
pb.AutoRedraw = -1 ' No, set one up.
End If
pb.Cls ' Clear off-screen image
pb.ScaleWidth = 100 ' Set for percentage
pb.DrawMode = 10 ' Set for erasable drawing
'
' Display the percentage, centered in the picture
' box.
'
num$ = Format$(percent, "##0") + "%"
pb.CurrentX = 50 - pb.TextWidth(num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(num$)) / 2
pb.Print num$ ' Display percentage
'
' Draw box over the percentage.
'
pb.Line (0, 0)-(percent, pb.ScaleHeight), , BF
pb.Refresh ' Show changes on screen
End Sub
'---使用方法--
For i = 1 to 100
UpdatePic Picture1 , i
Next i
#2
Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value=1
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value=1
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
#3
Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value = 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value = 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
#4
Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
#5
我不喜欢VB的进度条所以自己做了一个,也请大家给我提一些意见
For m = 1 To Max
Me.Picture3.Cls
Me.Picture3.Line (0, 0)-(Me.Picture3.ScaleWidth * m / Max, Me.Picture3.ScaleHeight), RGB(255, 255, 255), BF
Per = CStr(Round(m / Max, 2) * 100) & "%"
PrintLeft = (Me.Picture3.ScaleWidth - Me.TextWidth(Per)) / 2
Me.Picture3.CurrentX = PrintLeft
Me.Picture3.CurrentY = 10
Me.Picture3.Print Per
Me.Picture3.Refresh
Me.Refresh
Next m
For m = 1 To Max
Me.Picture3.Cls
Me.Picture3.Line (0, 0)-(Me.Picture3.ScaleWidth * m / Max, Me.Picture3.ScaleHeight), RGB(255, 255, 255), BF
Per = CStr(Round(m / Max, 2) * 100) & "%"
PrintLeft = (Me.Picture3.ScaleWidth - Me.TextWidth(Per)) / 2
Me.Picture3.CurrentX = PrintLeft
Me.Picture3.CurrentY = 10
Me.Picture3.Print Per
Me.Picture3.Refresh
Me.Refresh
Next m
#6
感谢几位朋友的参与,但是我觉得仍然没解决我的问题。我想实现的是多个并列循环的progressbar的value值的设定,这是我不会的地方。例如:
.....
progressbar.min=0
progressbar.max=adodc1.recordset.recordcount+adodc2.recordset.record count+adodc3.recordset.recordcount
while not adodc1.recordset
......
wend
while not adodc2.recordset
......
wend
while not adodc3.recordset
......
wend
上述程序中的progressbar.value值在循环中如何实现呢?
.....
progressbar.min=0
progressbar.max=adodc1.recordset.recordcount+adodc2.recordset.record count+adodc3.recordset.recordcount
while not adodc1.recordset
......
wend
while not adodc2.recordset
......
wend
while not adodc3.recordset
......
wend
上述程序中的progressbar.value值在循环中如何实现呢?
#7
在循环外时写一句
progressbar.value=0
然后在循环内,也就是你写省略号处写上
progressbar.value=progressbar.value+1
如果数目很大的话,你可以在这句的后面加上
me.refresh
progressbar.value=0
然后在循环内,也就是你写省略号处写上
progressbar.value=progressbar.value+1
如果数目很大的话,你可以在这句的后面加上
me.refresh
#8
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
.................................................
Set DataBase1 = New ADODB.Connection
Set TempRecord1 = New ADODB.Recordset
DataBase1.CursorLocation = adUseClient
DataBase1.Provider = "Microsoft.Jet.OLEDB.3.51"
DataBase1.Mode = adModeUnknown
DataBase1.ConnectionString = "User ID=admin;Data Source=" & filepath
DataBase1.Open
TempRecord1.LockType = adLockBatchOptimistic
TempRecord1.CursorType = adOpenKeyset
TempRecord1.Open "select * from 物价单", DataBase1
Form12.Show
MDIForm1.Enabled = False
Form12.Label1.Caption = "物价单" + " Loading............"
Form12.ProgressBar1.min = 0
Form12.ProgressBar1.Max = MDIForm1.TempRecord1.RecordCount + 1
Form12.ProgressBar1.Value = 1
Do While Not TempRecord1.EOF
Sleep 2
MDIForm1.TempRecord1.MoveNext
Form12.ProgressBar1.Value = Form12.ProgressBar1.Value + 1
Loop
.................................................
Set DataBase1 = New ADODB.Connection
Set TempRecord1 = New ADODB.Recordset
DataBase1.CursorLocation = adUseClient
DataBase1.Provider = "Microsoft.Jet.OLEDB.3.51"
DataBase1.Mode = adModeUnknown
DataBase1.ConnectionString = "User ID=admin;Data Source=" & filepath
DataBase1.Open
TempRecord1.LockType = adLockBatchOptimistic
TempRecord1.CursorType = adOpenKeyset
TempRecord1.Open "select * from 物价单", DataBase1
Form12.Show
MDIForm1.Enabled = False
Form12.Label1.Caption = "物价单" + " Loading............"
Form12.ProgressBar1.min = 0
Form12.ProgressBar1.Max = MDIForm1.TempRecord1.RecordCount + 1
Form12.ProgressBar1.Value = 1
Do While Not TempRecord1.EOF
Sleep 2
MDIForm1.TempRecord1.MoveNext
Form12.ProgressBar1.Value = Form12.ProgressBar1.Value + 1
Loop
#9
谢谢各位的关心,我现在由于到一点问题,那就是progressbar1.max值地设定出了点问题,在程序的初始,我设的值为:
ProgressBar1.Max = adodc1.recordset.recordcount+ Adodc2.Recordset.RecordCount + Adodc3.Recordset.RecordCount + Adodc4.Recordset.RecordCount + Adodc5.Recordset.RecordCount
但是现在有一个问题,即:
我首先在adodc1的循环中改变adodc2---adodc5中纪录的某些值,我在此循环后又需要改变adodc2---adodc5中的某些值,而且这些值的改变要用到在adodc1循环中这些表中改变的值。所以我不能首先在程序的开始确定adodc2----adodc5各表的纪录的数目,好心的人,我该怎么办呢?????????
急切需要您的帮助!!!!!!!!!
如果您还不明白我的意思的话,可以问我吗?谢谢!!
我的email:jiez00509@sina.com
ProgressBar1.Max = adodc1.recordset.recordcount+ Adodc2.Recordset.RecordCount + Adodc3.Recordset.RecordCount + Adodc4.Recordset.RecordCount + Adodc5.Recordset.RecordCount
但是现在有一个问题,即:
我首先在adodc1的循环中改变adodc2---adodc5中纪录的某些值,我在此循环后又需要改变adodc2---adodc5中的某些值,而且这些值的改变要用到在adodc1循环中这些表中改变的值。所以我不能首先在程序的开始确定adodc2----adodc5各表的纪录的数目,好心的人,我该怎么办呢?????????
急切需要您的帮助!!!!!!!!!
如果您还不明白我的意思的话,可以问我吗?谢谢!!
我的email:jiez00509@sina.com
#10
假如for i=1 to max,那么在循环中是可以改变max的值呀,例如
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
#11
假如for i=1 to max,那么在循环中是可以改变max的值呀,例如
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
#12
关注。
#13
up
#1
'看看我的进度条 !
Sub UpdatePic(pb As Control, ByVal percent)
Dim num$ ' Used to hold percent string
If Not pb.AutoRedraw Then ' Do we have off-screen image?
pb.AutoRedraw = -1 ' No, set one up.
End If
pb.Cls ' Clear off-screen image
pb.ScaleWidth = 100 ' Set for percentage
pb.DrawMode = 10 ' Set for erasable drawing
'
' Display the percentage, centered in the picture
' box.
'
num$ = Format$(percent, "##0") + "%"
pb.CurrentX = 50 - pb.TextWidth(num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(num$)) / 2
pb.Print num$ ' Display percentage
'
' Draw box over the percentage.
'
pb.Line (0, 0)-(percent, pb.ScaleHeight), , BF
pb.Refresh ' Show changes on screen
End Sub
'---使用方法--
For i = 1 to 100
UpdatePic Picture1 , i
Next i
Sub UpdatePic(pb As Control, ByVal percent)
Dim num$ ' Used to hold percent string
If Not pb.AutoRedraw Then ' Do we have off-screen image?
pb.AutoRedraw = -1 ' No, set one up.
End If
pb.Cls ' Clear off-screen image
pb.ScaleWidth = 100 ' Set for percentage
pb.DrawMode = 10 ' Set for erasable drawing
'
' Display the percentage, centered in the picture
' box.
'
num$ = Format$(percent, "##0") + "%"
pb.CurrentX = 50 - pb.TextWidth(num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(num$)) / 2
pb.Print num$ ' Display percentage
'
' Draw box over the percentage.
'
pb.Line (0, 0)-(percent, pb.ScaleHeight), , BF
pb.Refresh ' Show changes on screen
End Sub
'---使用方法--
For i = 1 to 100
UpdatePic Picture1 , i
Next i
#2
Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value=1
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value=1
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
#3
Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value = 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value = 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
#4
Private Sub Command1_Click()
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
Dim a As Double, s As Double, d As Double
Adodc1.RecordSource = "select * from 学生信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount=0 then
Exit Sub
End If
ProgressBar1.Min = 0
ProgressBar1.Max = Adodc1.Recordset.RecordCount
ProgressBar1.Value 0 '设置初始值
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
a = Adodc1.Recordset.Fields("借书数").Value
s = Adodc1.Recordset.Fields("x").Value
Adodc1.Recordset.Fields("y") = Adodc1.Recordset.Fields("y") + _
Val(a) + Val(s)
ProgressBar1.Value = ProgressBar1.Value + 1
Adodc1.Recordset.MoveNext
Wend
MsgBox ("OK")
End Sub
#5
我不喜欢VB的进度条所以自己做了一个,也请大家给我提一些意见
For m = 1 To Max
Me.Picture3.Cls
Me.Picture3.Line (0, 0)-(Me.Picture3.ScaleWidth * m / Max, Me.Picture3.ScaleHeight), RGB(255, 255, 255), BF
Per = CStr(Round(m / Max, 2) * 100) & "%"
PrintLeft = (Me.Picture3.ScaleWidth - Me.TextWidth(Per)) / 2
Me.Picture3.CurrentX = PrintLeft
Me.Picture3.CurrentY = 10
Me.Picture3.Print Per
Me.Picture3.Refresh
Me.Refresh
Next m
For m = 1 To Max
Me.Picture3.Cls
Me.Picture3.Line (0, 0)-(Me.Picture3.ScaleWidth * m / Max, Me.Picture3.ScaleHeight), RGB(255, 255, 255), BF
Per = CStr(Round(m / Max, 2) * 100) & "%"
PrintLeft = (Me.Picture3.ScaleWidth - Me.TextWidth(Per)) / 2
Me.Picture3.CurrentX = PrintLeft
Me.Picture3.CurrentY = 10
Me.Picture3.Print Per
Me.Picture3.Refresh
Me.Refresh
Next m
#6
感谢几位朋友的参与,但是我觉得仍然没解决我的问题。我想实现的是多个并列循环的progressbar的value值的设定,这是我不会的地方。例如:
.....
progressbar.min=0
progressbar.max=adodc1.recordset.recordcount+adodc2.recordset.record count+adodc3.recordset.recordcount
while not adodc1.recordset
......
wend
while not adodc2.recordset
......
wend
while not adodc3.recordset
......
wend
上述程序中的progressbar.value值在循环中如何实现呢?
.....
progressbar.min=0
progressbar.max=adodc1.recordset.recordcount+adodc2.recordset.record count+adodc3.recordset.recordcount
while not adodc1.recordset
......
wend
while not adodc2.recordset
......
wend
while not adodc3.recordset
......
wend
上述程序中的progressbar.value值在循环中如何实现呢?
#7
在循环外时写一句
progressbar.value=0
然后在循环内,也就是你写省略号处写上
progressbar.value=progressbar.value+1
如果数目很大的话,你可以在这句的后面加上
me.refresh
progressbar.value=0
然后在循环内,也就是你写省略号处写上
progressbar.value=progressbar.value+1
如果数目很大的话,你可以在这句的后面加上
me.refresh
#8
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
.................................................
Set DataBase1 = New ADODB.Connection
Set TempRecord1 = New ADODB.Recordset
DataBase1.CursorLocation = adUseClient
DataBase1.Provider = "Microsoft.Jet.OLEDB.3.51"
DataBase1.Mode = adModeUnknown
DataBase1.ConnectionString = "User ID=admin;Data Source=" & filepath
DataBase1.Open
TempRecord1.LockType = adLockBatchOptimistic
TempRecord1.CursorType = adOpenKeyset
TempRecord1.Open "select * from 物价单", DataBase1
Form12.Show
MDIForm1.Enabled = False
Form12.Label1.Caption = "物价单" + " Loading............"
Form12.ProgressBar1.min = 0
Form12.ProgressBar1.Max = MDIForm1.TempRecord1.RecordCount + 1
Form12.ProgressBar1.Value = 1
Do While Not TempRecord1.EOF
Sleep 2
MDIForm1.TempRecord1.MoveNext
Form12.ProgressBar1.Value = Form12.ProgressBar1.Value + 1
Loop
.................................................
Set DataBase1 = New ADODB.Connection
Set TempRecord1 = New ADODB.Recordset
DataBase1.CursorLocation = adUseClient
DataBase1.Provider = "Microsoft.Jet.OLEDB.3.51"
DataBase1.Mode = adModeUnknown
DataBase1.ConnectionString = "User ID=admin;Data Source=" & filepath
DataBase1.Open
TempRecord1.LockType = adLockBatchOptimistic
TempRecord1.CursorType = adOpenKeyset
TempRecord1.Open "select * from 物价单", DataBase1
Form12.Show
MDIForm1.Enabled = False
Form12.Label1.Caption = "物价单" + " Loading............"
Form12.ProgressBar1.min = 0
Form12.ProgressBar1.Max = MDIForm1.TempRecord1.RecordCount + 1
Form12.ProgressBar1.Value = 1
Do While Not TempRecord1.EOF
Sleep 2
MDIForm1.TempRecord1.MoveNext
Form12.ProgressBar1.Value = Form12.ProgressBar1.Value + 1
Loop
#9
谢谢各位的关心,我现在由于到一点问题,那就是progressbar1.max值地设定出了点问题,在程序的初始,我设的值为:
ProgressBar1.Max = adodc1.recordset.recordcount+ Adodc2.Recordset.RecordCount + Adodc3.Recordset.RecordCount + Adodc4.Recordset.RecordCount + Adodc5.Recordset.RecordCount
但是现在有一个问题,即:
我首先在adodc1的循环中改变adodc2---adodc5中纪录的某些值,我在此循环后又需要改变adodc2---adodc5中的某些值,而且这些值的改变要用到在adodc1循环中这些表中改变的值。所以我不能首先在程序的开始确定adodc2----adodc5各表的纪录的数目,好心的人,我该怎么办呢?????????
急切需要您的帮助!!!!!!!!!
如果您还不明白我的意思的话,可以问我吗?谢谢!!
我的email:jiez00509@sina.com
ProgressBar1.Max = adodc1.recordset.recordcount+ Adodc2.Recordset.RecordCount + Adodc3.Recordset.RecordCount + Adodc4.Recordset.RecordCount + Adodc5.Recordset.RecordCount
但是现在有一个问题,即:
我首先在adodc1的循环中改变adodc2---adodc5中纪录的某些值,我在此循环后又需要改变adodc2---adodc5中的某些值,而且这些值的改变要用到在adodc1循环中这些表中改变的值。所以我不能首先在程序的开始确定adodc2----adodc5各表的纪录的数目,好心的人,我该怎么办呢?????????
急切需要您的帮助!!!!!!!!!
如果您还不明白我的意思的话,可以问我吗?谢谢!!
我的email:jiez00509@sina.com
#10
假如for i=1 to max,那么在循环中是可以改变max的值呀,例如
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
#11
假如for i=1 to max,那么在循环中是可以改变max的值呀,例如
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
max=3
for i=0 to max
max=max+1
next i
我想上面的这段程序一定是一个死循环的。
#12
关注。
#13
up