Y
Yarik
Hello,
We have an MS Access 2003 application (ADP). There is a view in SQL
Server 2000 database that takes quite some time to run (2-3 minutes or
so). When our application opens this view using DoCmd.OpenView
function, everything is fine. However, when user starts playing with
filtering on the resulting form, sometimes an attempt to apply a
filter results in "Timeout" error (and sometimes it even crashes MS
Access afterwards). This happens even with very primitive filtering
criteria - like ">0" for some numeric column.
Does anyone know why this might be happening and how it could be
fixed.
Perhaps it is somehow connected to the fact that the view itself is
very complex and takes a lot of time to open. By default,
DoCmd.OpenView could not open it at all, so we had to change the OLE/
DDE timeout option programmatically before invoking OpenView (see the
code snippet below). However, this trick helped only with initial
opening of the view; the timeout specified programmaticall does not
have any effect on the problem described above.
Please help!
Thanks,
Yarik.
P.S. FWIW, here is the code snippet demonstrating how the view is
being opened in our application:
Dim oldTimeout As Integer: oldTimeout = 0
Const sTimeoutOption = "OLE/DDE Timeout (sec)" As String
oldTimeout = Application.GetOption(sTimeoutOption)
Call Application.SetOption(sTimeoutOption, MyTimeout)
Call DoCmd.OpenView("MyView", acViewNormal, acReadOnly)
If oldTimeout <> 0 Then
Call Application.SetOption(sTimeoutOption, oldTimeout)
End If
We have an MS Access 2003 application (ADP). There is a view in SQL
Server 2000 database that takes quite some time to run (2-3 minutes or
so). When our application opens this view using DoCmd.OpenView
function, everything is fine. However, when user starts playing with
filtering on the resulting form, sometimes an attempt to apply a
filter results in "Timeout" error (and sometimes it even crashes MS
Access afterwards). This happens even with very primitive filtering
criteria - like ">0" for some numeric column.
Does anyone know why this might be happening and how it could be
fixed.
Perhaps it is somehow connected to the fact that the view itself is
very complex and takes a lot of time to open. By default,
DoCmd.OpenView could not open it at all, so we had to change the OLE/
DDE timeout option programmatically before invoking OpenView (see the
code snippet below). However, this trick helped only with initial
opening of the view; the timeout specified programmaticall does not
have any effect on the problem described above.
Please help!
Thanks,
Yarik.
P.S. FWIW, here is the code snippet demonstrating how the view is
being opened in our application:
Dim oldTimeout As Integer: oldTimeout = 0
Const sTimeoutOption = "OLE/DDE Timeout (sec)" As String
oldTimeout = Application.GetOption(sTimeoutOption)
Call Application.SetOption(sTimeoutOption, MyTimeout)
Call DoCmd.OpenView("MyView", acViewNormal, acReadOnly)
If oldTimeout <> 0 Then
Call Application.SetOption(sTimeoutOption, oldTimeout)
End If