Hello guys.
I have a SQL table which uses ODBC from Access. I have a relatively large table with 850 000 rows. Today i tried to update a field in the table from NULL to a textvalue.
I clocked the speed of the update to 3300 rows a minute, what do u think about the speed?
What do u think about the speed? Anybody got any tips to make this operation faster?
I have a SQL table which uses ODBC from Access. I have a relatively large table with 850 000 rows. Today i tried to update a field in the table from NULL to a textvalue.
I clocked the speed of the update to 3300 rows a minute, what do u think about the speed?
Code:
Dim t As Long
Dim d As Date
Dim dt As Date
Dim i As Long
Dim prmin As Long
d = Now
t = 1
Dim rst As New ADODB.Recordset
With rst
.Open "SELECT * from [LOK Loksummer - flytthistorikk] where hendelse = 'batchpakking' and pakkealternativ is null", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Do Until .EOF
.MoveNext
i = i + 1
Loop
.MoveFirst
Do Until .EOF
t = t + 1
!pakkealternativ = "1/1"
.Update
If Right(t, 1) = 0 Then
prmin = t / DateDiff("s", d, Now)
Me.Etikett12.Caption = t & " av " & i & " er oppdatert" & vbCrLf & "Pr minutt:" & prmin * 60 & vbCrLf & "Gjenstående:" & i - t & vbCrLf & "Ferdig klokka:" & DateAdd("s", (i - t) / prmin, Now)
Me.Repaint
End If
.MoveNext
Loop
.Close
End With
Comment