W
wk6pack
Hi,
I'm getting this error on my asp page intermittently. One day it is fine,
another day, it crashes a lot. I have searched the web and microsoft on
this and they say it is a recordset assigned to a session variable.
I dont assign any record sets to session variables in my code. I assign
values to the session variables though.
The place it seems to crash is Set AccessConn =
Server.CreateObject("ADODB.Connection")
code:
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.mapPath("EmployeeTransactions.mdb")
Set AccessConn = Server.CreateObject("ADODB.Connection")
AccessConn.open connstr
'get session("loc") to see if they are allowed to update records
lloc = session("sploctype")
loccode = session("splocationdesc")
'Determining the ability to access update records
if lloc = "School" then
accessupdate = 0
else
accessupdate = 1
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select emprecid, employeeno, employeelastname, employeefirstname,
iif(isnull(hrstatus),' ',hrstatus) as hrstatus,
iif(isnull(hrdate),' ',hrdate) as hrdate,
iif(isnull(budgetstatus),' ',budgetstatus) as budgetstatus,
iif(isnull(budgetdate),' ',budgetdate) as budgetdate," & _
" iif(isnull(payrollstatus),' ',payrollstatus) as payrollstatus,
iif(isnull(payrolldate),' ',payrolldate) as payrolldate,
iif(isnull(benefitdate),' ',benefitdate) as benefitdate,
iif(isnull(createdby),' ',createdby) as createdby,
iif(isnull(processstatus),' ',processstatus) as processstatus,
employeetype, location from employeetransaction "
'we only display the records for the school location otherwise, we display
all for departments
if lloc="School" then
sql = sql & " where location = '" & loccode & "' and
((EmployeeTransaction.PayrollDate >=(date()-30)) OR
(Isnull([EmployeeTransaction].[PayrollDate])<> FALSE)) order by emprecid
desc "
else
sql = sql & " where ((EmployeeTransaction.PayrollDate >= (date()-30)) OR
(Isnull([EmployeeTransaction].[PayrollDate])<>FALSE)) order by emprecid desc
"
end if
set rs = AccessConn.execute(sql)
Any ideas??
thanks,
Will
I'm getting this error on my asp page intermittently. One day it is fine,
another day, it crashes a lot. I have searched the web and microsoft on
this and they say it is a recordset assigned to a session variable.
I dont assign any record sets to session variables in my code. I assign
values to the session variables though.
The place it seems to crash is Set AccessConn =
Server.CreateObject("ADODB.Connection")
code:
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.mapPath("EmployeeTransactions.mdb")
Set AccessConn = Server.CreateObject("ADODB.Connection")
AccessConn.open connstr
'get session("loc") to see if they are allowed to update records
lloc = session("sploctype")
loccode = session("splocationdesc")
'Determining the ability to access update records
if lloc = "School" then
accessupdate = 0
else
accessupdate = 1
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select emprecid, employeeno, employeelastname, employeefirstname,
iif(isnull(hrstatus),' ',hrstatus) as hrstatus,
iif(isnull(hrdate),' ',hrdate) as hrdate,
iif(isnull(budgetstatus),' ',budgetstatus) as budgetstatus,
iif(isnull(budgetdate),' ',budgetdate) as budgetdate," & _
" iif(isnull(payrollstatus),' ',payrollstatus) as payrollstatus,
iif(isnull(payrolldate),' ',payrolldate) as payrolldate,
iif(isnull(benefitdate),' ',benefitdate) as benefitdate,
iif(isnull(createdby),' ',createdby) as createdby,
iif(isnull(processstatus),' ',processstatus) as processstatus,
employeetype, location from employeetransaction "
'we only display the records for the school location otherwise, we display
all for departments
if lloc="School" then
sql = sql & " where location = '" & loccode & "' and
((EmployeeTransaction.PayrollDate >=(date()-30)) OR
(Isnull([EmployeeTransaction].[PayrollDate])<> FALSE)) order by emprecid
desc "
else
sql = sql & " where ((EmployeeTransaction.PayrollDate >= (date()-30)) OR
(Isnull([EmployeeTransaction].[PayrollDate])<>FALSE)) order by emprecid desc
"
end if
set rs = AccessConn.execute(sql)
Any ideas??
thanks,
Will