Connecting Tech Pros Worldwide Forums | Help | Site Map

A very slow Loop

giannis
Guest
 
Posts: n/a
#1: Feb 12 '07
At the below code i search for a value of a field of a BindingSource
and when not found i search for the 40 earlier values inside a Loop.

At the Access VB i used the same Loop with the command "DoCmd.FindRecord"
and the rapidity was very much big.

Now at the VB this Loop be late very much (it is very slow). :(
Why this happens and how can i resolve this problem ?
Is there any other way to make this loop more fast ?


Dim found As Integer = My.Forms.skitso.SKITSABind.Find("skitsa", w)

If found -1 Then

My.Forms.skitso.SKITSABind.Position() = found

Else

p = Val(w)

Do

found = My.Forms.skitso.SKITSABind.Find("skitsa", Trim(Str(p)))

If found < 0 Then p = p - 1

If found -1 Or Val(w) - p 40 Or p < 15 Then Exit Do

Loop

If found -1 Then

My.Forms.skitso.SKITSABind.Position() = found

End If

Ånd If



rowe_newsgroups
Guest
 
Posts: n/a
#2: Feb 12 '07

re: A very slow Loop


On Feb 12, 12:02 pm, "giannis" <zzzinob...@freemail.grwrote:
Quote:
At the below code i search for a value of a field of a BindingSource
and when not found i search for the 40 earlier values inside a Loop.
>
At the Access VB i used the same Loop with the command "DoCmd.FindRecord"
and the rapidity was very much big.
>
Now at the VB this Loop be late very much (it is very slow). :(
Why this happens and how can i resolve this problem ?
Is there any other way to make this loop more fast ?
>
Dim found As Integer = My.Forms.skitso.SKITSABind.Find("skitsa", w)
>
If found -1 Then
>
My.Forms.skitso.SKITSABind.Position() = found
>
Else
>
p = Val(w)
>
Do
>
found = My.Forms.skitso.SKITSABind.Find("skitsa", Trim(Str(p)))
>
If found < 0 Then p = p - 1
>
If found -1 Or Val(w) - p 40 Or p < 15 Then Exit Do
>
Loop
>
If found -1 Then
>
My.Forms.skitso.SKITSABind.Position() = found
>
End If
>
Ånd If
What exactly is this supposed to accomplish?

Thanks,

Seth Rowe

punjab_tom
Guest
 
Posts: n/a
#3: Feb 12 '07

re: A very slow Loop


sorry dog this dotnet crap is slower than Access is, for development
and execution time

Closed Thread