A
Aubrey
Users are experiencing "Not Responding" conditions of 2-3 minutes with this
Code. The tblNotes has 36,351 Rows; tblNoteNarrative has 20,245 Rows. During
Beta testing, this code ran extremely fast (1-2 Seconds) against a
stand-alone sample database. Did moving it to a Remote Server and connectiong
to an Anonymous Merge Subscription replica add Columns that need indexing? Or
do I need to use different values for the .Open Parameters?
Each of these Lines take some 15-20 seconds to respond in Single-Step Debug:
rst1.Open "tblNotes", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
rst2.Open strTblName, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
- - - - - - - - - -
Private Sub AddNewNote(lngNType As Long, strNBrief As String, strTblName As
String, strFrmName As String)
On Error GoTo Err_Handler
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
Dim lngNID As Long
Randomize
lngNID = Int((Rnd * 2 ^ 30) - 2 ^ 29)
rst1.Open "tblNotes", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
rst1.AddNew
rst1![Patient ID #] = Me!Text219
rst1![PID] = Me!Text387
rst1![NDate] = Now()
rst1![ProvID] = pstrLogonID
rst1![NType] = lngNType
rst1![NBrief] = strNBrief
rst1![IsSaved] = True
rst1![NID] = lngNID
rst1.Update
rst1.Close
Set rst1 = Nothing
rst2.Open strTblName, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
rst2.AddNew
rst2![Patient ID #] = Me!Text219
rst2![PID] = Me!Text387
rst2![SysDate] = Now()
rst2![VisitDate] = DateValue(Now())
rst2![ProvID] = pstrLogonID
rst2![IsSaved] = True
rst2![NID] = lngNID
rst2.Update
rst2.Close
Set rst2 = Nothing
Me.Refresh
DoCmd.OpenForm strFrmName, , , "[NID]=" & lngNID
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Handler
End Sub
- - - - - - - - - -
Access 10 Project Runtime on MSDERelA in Windows XP Pro Notebooks. Database
is a 413 MB Anonymous Merge Subscription.
Code. The tblNotes has 36,351 Rows; tblNoteNarrative has 20,245 Rows. During
Beta testing, this code ran extremely fast (1-2 Seconds) against a
stand-alone sample database. Did moving it to a Remote Server and connectiong
to an Anonymous Merge Subscription replica add Columns that need indexing? Or
do I need to use different values for the .Open Parameters?
Each of these Lines take some 15-20 seconds to respond in Single-Step Debug:
rst1.Open "tblNotes", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
rst2.Open strTblName, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
- - - - - - - - - -
Private Sub AddNewNote(lngNType As Long, strNBrief As String, strTblName As
String, strFrmName As String)
On Error GoTo Err_Handler
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
Dim lngNID As Long
Randomize
lngNID = Int((Rnd * 2 ^ 30) - 2 ^ 29)
rst1.Open "tblNotes", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
rst1.AddNew
rst1![Patient ID #] = Me!Text219
rst1![PID] = Me!Text387
rst1![NDate] = Now()
rst1![ProvID] = pstrLogonID
rst1![NType] = lngNType
rst1![NBrief] = strNBrief
rst1![IsSaved] = True
rst1![NID] = lngNID
rst1.Update
rst1.Close
Set rst1 = Nothing
rst2.Open strTblName, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
rst2.AddNew
rst2![Patient ID #] = Me!Text219
rst2![PID] = Me!Text387
rst2![SysDate] = Now()
rst2![VisitDate] = DateValue(Now())
rst2![ProvID] = pstrLogonID
rst2![IsSaved] = True
rst2![NID] = lngNID
rst2.Update
rst2.Close
Set rst2 = Nothing
Me.Refresh
DoCmd.OpenForm strFrmName, , , "[NID]=" & lngNID
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Handler
End Sub
- - - - - - - - - -
Access 10 Project Runtime on MSDERelA in Windows XP Pro Notebooks. Database
is a 413 MB Anonymous Merge Subscription.