Random error 80020009 accesing an Access 2000 database from a classic asp webpage -
i running query classic asp webpage microsoft access 2000 database table return query of names , perform calculation. database has been running years, , queries in past have been succesful. of sudden past few months, of names , calculations displayed, following error appears: error 80020009. on bottom of displayed query, person's name displayed, calculation field not displayed; blank. calculation feild using count option in classic asp, , text data type in microsoft access. error message never appeared until last few months, strange. able find records in microsoft access table (in development environment) causing errors specific month, don't want have delete records in production environment. if run sql query in microsoft access, of records in given month in table (where issues apepars) fine, , no errors appear. have exported , imported access table, 8002009 error still appears.
has experienced issue this? sound classic asp coding issue, or issue microsoft access 2000 database table itself.
thanks assistance in advance.
<div> <br /> <h1 class="main">co report</h1> <hr class="main"> <blockquote> <form method="post" action="os.asp" name="form2"> <p>month query: <select size="1" name="ddmonth"> <% dim = 1 12 if = month(date) %> <option selected value="<%=i%>"><%=monthname(i)%></option> <% 'select current month else %> <option value="<%=i%>"><%=monthname(i)%></option> <% end if next %></select> <select size="1" name="ddyear"> <% dim intyear intyear = 2001 year(date) response.write ("<option selected>" & intyear & "</option>") next %></select> <input type="submit" value="query cs" name="btnquery"></p> </form> <hr /><br /> <% if request.form("btnquery") <> "" 'display table based on selected month , year 'setup query strconn = "provider=microsoft.jet.oledb.4.0; data source=d:\store\stats\data\pros.mdb" set cnn = server.createobject("adodb.connection") cnn.open strconn 'open recordset set rstdata = server.createobject("adodb.recordset") rstdata.open "select * [tv] order toc", cnn, adopenkeyset %> <table border="1" width="100%" id="autonumber2" height="18" cellspacing="1"> <caption>cu-out results <%=monthname(request.form("ddmonth"))%>, <%=request.form("ddyear")%></caption> <tr> <th>officer's name</th> <th>minutes achieved - cuw</th> <th>net minutes worked (hours worked - exception)</th> <th>% of productivity</th> </tr> <% 'set date values dim year2, day2, month2 year2 = trim(request.form("ddyear")) month2 = trim(request.form("ddmonth")) 'open cuot data month set rstdata1 = server.createobject("adodb.recordset") 'cuot 'open table grab names of entered data during month selected rstdata1.open "select distinct [name] cuot month(date)= '" & month2 & "' , year(date) ='" & year2 & "' order [name]", cnn, adopenkeyset set rstdata3 = server.createobject("adodb.recordset") 'hours worked set rstdata4 = server.createobject("adodb.recordset") 'exception until rstdata1.eof = true %><tr> <td><%=rstdata1("name")%> </td> <% 'do math calculations minute achieved set rstdata0 = server.createobject("adodb.recordset") 'cuot rstdata0.open "select count(toc) count1, toc cuot [name] = '" & replace(rstdata1("name"), "'", "''") & "' , month(date)= '" & month2 & "' , year(date) ='" & year2 & "' group toc order toc", cnn, adopenkeyset rstdata.movefirst 'tv table "minutes achieved" rstdata0.movefirst 'cuot list cuachieved = 0 until rstdata0.eof = true 'loop through rstdata.toc until match found rstdata0.toc until trim(rstdata("toc")) = trim(rstdata0("toc")) rstdata.movenext loop if rstdata("per_day") <> "0" cuachieved = cdbl(cuachieved) + (cdbl(rstdata0("count1"))/cdbl(rstdata("per_day"))*450) rstdata.movenext rstdata0.movenext loop %><td><%=round(cuachieved)%> </td> <% 'open hoursworked table rstdata3.open "select * monthlyhr [name] = '" & replace(rstdata1("name"), "'", "''") & "' , month(date) ='" & month2 & "' , year(date) = '" & year2 & "'", cnn, adopenkeyset 'should ever 1 record, check if there no records if rstdata3.eof = true %><td>n/a</td> <% 'net minutes worked %><td>n/a</td> <% '% of productivity else 'open exception table 'get approved exception rstdata4.open "select [name], sum(approval) sum1 [exception] [name] = '" & replace(rstdata1("name"), "'", "''") & "' , month(date) ='" & month2 & "' , year(date) = '" & year2 & "' group [name]", cnn, adopenkeyset if rstdata4.eof = true exception2 = 0 else exception2 = rstdata4("sum1") end if rstdata4.close 'do math actual (hours worked + overtime - leave -exception) hoursworked2 = (cdbl(rstdata3("hours")) + cdbl(rstdata3("ot")) - cdbl(rstdata3("leave")) - cdbl(exception2)) %><td><%=hoursworked2*60%> </td> <% 'calculate percentage of csu+ops/minutes worked percenttotal = round(cdbl(cuachieved)/(cdbl(hoursworked2)*60)*100) 'percent %><td><%=percenttotal%> </td> </tr> <tr> <% end if rstdata1.movenext rstdata3.close loop rstdata.close 'close databases set rstdata = nothing rstdata1.close set rstdata1 = nothing set rstdata3 = nothing set rstdata4 = nothing cnn.close set cnn=nothing %> </tr> </table> <% end if 'end query%> </blockquote> </div> <!-- instanceendeditable --></div> <!-- end of div.blackborder --> </div>
Comments
Post a Comment