snerting
Programmer
- Oct 20, 2005
- 52
Hi!
Suddenly .Addnew is hanging for about 15-20 seconds on my ADO-recordset. It is working fine most places, but this one place is lagging. It does finish in the end, but with this latency it's pretty much useless.
Now, .Addnew isn't even supposed to talk to the database, is it? Anyway, it's Access 2003, VB6, ODBC using Oracle ODBC Driver from Oracle 8. The server is 10G, but the 8 adapter is working perfectly everywhere, even from Access, except for this one place where it hangs. If .Addnew isn't speaking to the database at all, then it shouldn't matter anyway.
Code is fairly simple. It returns a clone of current entry in l_rstCloneMe. The code calling it is looping over l_rstlCloneMe, feeding "cloneEntry()" with one record at the time. rsCopy is closed in the other function (some changes are made to the clone before it is updated and closed).
'Returns clone
Public Function cloneEntry(l_rstCloneMe As Recordset) As Recordset
' copy existing dataset-entry to new row.
Dim i As Integer
Dim rsCopy As Recordset
Dim rsNew As Recordset
Dim rssource As String
rssource = stripWhereOrderByGroupByClauses(rsCopy.name)
Set rsCopy = l_rstCloneMe ' source for copy
Set rsNew = dbs.OpenRecordset(rssource) ' destination of copy
rsNew.AddNew ' empty row for the new row which is a duplicate of the old. Lagging 15-20 seconds
For i = 0 To rsCopy.Fields.Count - 1
rsNew.Fields(i).Value = rsCopy.Fields(i).Value
Next i
Set cloneEntry = rsNew
End Function
Suddenly .Addnew is hanging for about 15-20 seconds on my ADO-recordset. It is working fine most places, but this one place is lagging. It does finish in the end, but with this latency it's pretty much useless.
Now, .Addnew isn't even supposed to talk to the database, is it? Anyway, it's Access 2003, VB6, ODBC using Oracle ODBC Driver from Oracle 8. The server is 10G, but the 8 adapter is working perfectly everywhere, even from Access, except for this one place where it hangs. If .Addnew isn't speaking to the database at all, then it shouldn't matter anyway.
Code is fairly simple. It returns a clone of current entry in l_rstCloneMe. The code calling it is looping over l_rstlCloneMe, feeding "cloneEntry()" with one record at the time. rsCopy is closed in the other function (some changes are made to the clone before it is updated and closed).
'Returns clone
Public Function cloneEntry(l_rstCloneMe As Recordset) As Recordset
' copy existing dataset-entry to new row.
Dim i As Integer
Dim rsCopy As Recordset
Dim rsNew As Recordset
Dim rssource As String
rssource = stripWhereOrderByGroupByClauses(rsCopy.name)
Set rsCopy = l_rstCloneMe ' source for copy
Set rsNew = dbs.OpenRecordset(rssource) ' destination of copy
rsNew.AddNew ' empty row for the new row which is a duplicate of the old. Lagging 15-20 seconds
For i = 0 To rsCopy.Fields.Count - 1
rsNew.Fields(i).Value = rsCopy.Fields(i).Value
Next i
Set cloneEntry = rsNew
End Function