Hiya all,
I have inherited this problem from someone else. We have asp pages that call an access database. Every 2 -3 days we have to close the web server down (asp and access db on same server - i know!).
I am assumming that the problem lies with connections not being closed to the server correctly, but i am not sure how to verify this!!! the connection used are as follows:
Sub Initialize_Page()
Call ToDo()
End Sub
Sub ToDo()
If Session("ID") = "" Then Exit Sub
'### INITIALISE VARIABLES ###
Requisitions = 0
Invoices = 0
POs = 0
ReqAuthorisations = 0
InvAuthorisations = 0
InvPrint = 0
Assets = 0
'### FETCH COUNT VALUES OF OUTSTANDING TASKS FOR THE USER ###
' this is an DSN less connection
Call OpenDB()
With rsDBdata
strSQL = "SELECT Count" 'etc etc
.Open strSQL
If .RecordCount > 0 Then
Requisitions = .Fields("Total").value
Else
Requisitions = 0
End If
.Close
strSQL = "SELECT Count(Tracer.SERIAL_NO) AS Total FROM" 'etc etc
.Open strSQL
If .RecordCount > 0 Then
WaitingInvoices = .Fields("Total").value
Else
WaitingInvoices = 0
End If
.Close
'Under here there are another 5 select statements
End With
Call DataDB()
End Sub
%>
When eventually the system grinds to a halt it fails in the following routine: (at the .Open command).
Private Sub OpenDB()
Set conDB = Server.CreateObject("ADODB.Connection")
With conDB
.ConnectionString = GetConnectionString("SOme connection string")
.ConnectionTimeOut = 30 'seconds
.Open
End With
Set cmdALL = Server.CreateObject("ADODB.Command")
With cmdALL
.ActiveConnection = conDB
.CommandTimeOut = 300 'seconds
End With
Set rsDB = Server.CreateObject("ADODB.Recordset")
With rsDB
.ActiveConnection = conDB
.CursorLocation = 3
.CursorType = 3
.LockType = 1
End With
Set rsDBTemp = Server.CreateObject("ADODB.Recordset")
With rsDBTemp
.ActiveConnection = conDB
.CursorLocation = 3
.CursorType = 3
.LockType = 1
End With
End Sub
Any thoughts would be much appreciated.
Cheers
Gav
I have inherited this problem from someone else. We have asp pages that call an access database. Every 2 -3 days we have to close the web server down (asp and access db on same server - i know!).
I am assumming that the problem lies with connections not being closed to the server correctly, but i am not sure how to verify this!!! the connection used are as follows:
Sub Initialize_Page()
Call ToDo()
End Sub
Sub ToDo()
If Session("ID") = "" Then Exit Sub
'### INITIALISE VARIABLES ###
Requisitions = 0
Invoices = 0
POs = 0
ReqAuthorisations = 0
InvAuthorisations = 0
InvPrint = 0
Assets = 0
'### FETCH COUNT VALUES OF OUTSTANDING TASKS FOR THE USER ###
' this is an DSN less connection
Call OpenDB()
With rsDBdata
strSQL = "SELECT Count" 'etc etc
.Open strSQL
If .RecordCount > 0 Then
Requisitions = .Fields("Total").value
Else
Requisitions = 0
End If
.Close
strSQL = "SELECT Count(Tracer.SERIAL_NO) AS Total FROM" 'etc etc
.Open strSQL
If .RecordCount > 0 Then
WaitingInvoices = .Fields("Total").value
Else
WaitingInvoices = 0
End If
.Close
'Under here there are another 5 select statements
End With
Call DataDB()
End Sub
%>
When eventually the system grinds to a halt it fails in the following routine: (at the .Open command).
Private Sub OpenDB()
Set conDB = Server.CreateObject("ADODB.Connection")
With conDB
.ConnectionString = GetConnectionString("SOme connection string")
.ConnectionTimeOut = 30 'seconds
.Open
End With
Set cmdALL = Server.CreateObject("ADODB.Command")
With cmdALL
.ActiveConnection = conDB
.CommandTimeOut = 300 'seconds
End With
Set rsDB = Server.CreateObject("ADODB.Recordset")
With rsDB
.ActiveConnection = conDB
.CursorLocation = 3
.CursorType = 3
.LockType = 1
End With
Set rsDBTemp = Server.CreateObject("ADODB.Recordset")
With rsDBTemp
.ActiveConnection = conDB
.CursorLocation = 3
.CursorType = 3
.LockType = 1
End With
End Sub
Any thoughts would be much appreciated.
Cheers
Gav