i am using vb6
i have a follwing code which insert data into the table
the code is working fine and now i want to add a progrss bar to it so i can show user how much time it takes
proviosly i have no experien using a progress bar
i had try it my making like this
but it is giving me error on minimum value
how to slove this
i have a follwing code which insert data into the table
Code:
‘ Note fromint and toint can be any interger like 10000 -12000 inputed by user
For a = fromint To toint
Dim numberstr As String
Dim numbercmd As Command
Set numbercmd = New Command
numberstr = "INSERT INTO invtemp ([Invoice No]) VALUES (" & a & ")" ‘There are more field but I remove them to simplify it
numbercmd.ActiveConnection = con
numbercmd.CommandText = numberstr
numbercmd.Execute
End If
Next a
the code is working fine and now i want to add a progrss bar to it so i can show user how much time it takes
proviosly i have no experien using a progress bar
i had try it my making like this
Code:
‘ Note fromint and toint can be any interger like 10000 -12000 inputed by user
[b][i]ProgressBar1.Min = fromint[/i][/b]
[b][i]ProgressBar1.Max = toint [/i][/b]
For a = fromint To toint
Dim numberstr As String
Dim numbercmd As Command
Set numbercmd = New Command
numberstr = "INSERT INTO invtemp ([Invoice No]) VALUES (" & a & ")" ‘There are more field but I remove them to simplify it
numbercmd.ActiveConnection = con
numbercmd.CommandText = numberstr
numbercmd.Execute
[b][i]ProgressBar1.Value = ProgressBar1.Value + 1[/i][/b]
End If
Next a
but it is giving me error on minimum value
how to slove this
Comment