473,225 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

Error code 80020009 "Exception Occured"

Hey guys, I'm back again....I've got the results displaying that I
wanted but instead of having a "next" or "previous" link displayed I
am getting the error msg below (I actually get the data that I'm
supposed to get meaning that my query seems to be working fine but
instead of making its way to the INCLUDE file (bottom navigation bar)
it displays the following error msg instead of the included nav bar...

***
error '80020009'
Exception occurred.

/jax/wh/Online_Forms/Secured_Archives/search_files/search_results_hour.asp,
line 57
***

"Line 57" is the line that says

Response.Write "<b>Name :</b> " & rs("name")

(the start of my display)...

I think that it's having trouble figuring out what to do to "close up"
my recordset query....Can you take a look and let me know what I'm
doing wrong or any suggestions?

I searched thru all previous posts and couldn't find anything that
explained it sufficiently....I also found a post at <a
href="http://www.aspfaq.com/show.asp?id=2188">ASP Faq's</a> that
explained to some degree so instead of "SELECT *" I input all the
corresponding columns in the database...Still no luck....

<!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
<%

Mode = request.form("mode")
Name = request.form("name")
Shift = request.form("shift")
Wave = request.form("wave")
Carton = request.form("carton")
Location = request.form("location")
License = request.form("license")
Sku = request.form("sku")
Qty = request.form("quantity")
Reason = request.form("reason")
Comments = request.form("comments")
Results = DateAdd("h", -1, Now())

'************************************************* ****************************
'* DATABASE APPENDING
*
'************************************************* ****************************
'create db connection
Set dbconn = Server.CreateObject("ADODB.Connection")

'create recordset object
Set rs = Server.CreateObject("ADODB.Recordset")

'open db in a DSN-less method
dbconn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage.mdb")

If IsEmpty (Request.QueryString("pageNum")) Then
curPage = 1
Else
curPage = CInt(Request.QueryString("pageNum"))
End If

'specify more info about rs
rs.CursorLocation = 3
rs.CursorType = 3
rs.PageSize = 3
rs.open "shortage", dbconn

'sql statement to return input values drawn from html fields within
previous week
SQLqry = "SELECT name, shift, wave, carton, location, license, sku,
qty, reason, comments, date FROM shortage WHERE date >= #" & Results &
"# ORDER BY date"

'display results of statement on screen for debugging
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

rs.Close
rs.Open SQLqry

If Not rs.EOF Then
rs.AbsolutePage = curPage
Response.Write "<p>You are on page: " & curPage & " of " &
rs.PageCount
Response.Write "<br>"
Response.Write "<br>"

For i = 1 to rs.PageSize
Response.Write "<b>Name :</b> " & rs("name")
Response.Write "<br>"
Response.Write "<b>Shift :</b> " & rs("shift")
Response.Write "<br>"
Response.Write "<b>Wave Number :</b> " & rs("wave")
Response.Write "<br>"
Response.Write "<b>Carton Number :</b> " & rs("carton")
Response.Write "<br>"
Response.Write "<b>Location :</b> " & rs("location")
Response.Write "<br>"
Response.Write "<b>License :</b> " & rs("license")
Response.Write "<br>"
Response.Write "<b>SKU :</b> " & rs("sku")
Response.Write "<br>"
Response.Write "<b>Quantity :</b> " & rs("qty")
Response.Write "<br>"
Response.Write "<b>Reason :</b> " & rs("reason")
Response.Write "<br>"
Response.Write "<b>Comments :</b> " & rs("comments")
Response.Write "<br>"
Response.Write "<b>Date Submitted :</b> " & rs("date")
Response.Write "<hr>"
rs.MoveNext
Next

ElseIf rs.EOF Then
Response.Write "<h3><b>I'm sorry but no records were found matching
that description!</b></h3>"
End If

If curPage > 1 then
Response.Write "<a href='search_results_hour.asp?pageNum=" &
curPage-1 & "'>Previous</a>"
If curPage < rs.PageCount then
Response.Write " | "
end if
end if
If curPage < rs.PageCount then
Response.Write "<a href='search_results_hour.asp?pageNum=" &
curPage+1 & "'>Next</a>"
end if
'close recordset
rs.Close

'zero out recordset object
Set rs = Nothing

'smack around the db connection until it lets go
dbconn.Close

'terminate db connection with extreme prejudice
set dbconn = nothing

Response.Write "<br><a href='../Archives.asp'>Return to Archives</a>"
Response.Write "<br><a href='../../Shortage.asp'>Return to Shortage
Submission Form</a>"
Response.Write "<br><a href='../../../default.asp'>Return to Warehouse
Operations</a>"
%><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
Jul 19 '05 #1
2 6240
BTR
My guess is that you close the recordset before calling anything with it then you close it again at the end - get rid of the first one here

'display results of statement on screen for debugging
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

rs.Close <--- Most likely your problem
rs.Open SQLqry
On 17 Aug 2004 09:09:39 -0700, dm**********@yahoo.com (dmiller23462) wrote:
rs.Close
rs.Open SQLqry


Jul 19 '05 #2
BTR <no****@msn.com> wrote in message news:<kj********************************@4ax.com>. ..
My guess is that you close the recordset before calling anything with it then you close it again at the end - get rid of the first one here

'display results of statement on screen for debugging
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

rs.Close <--- Most likely your problem
rs.Open SQLqry
On 17 Aug 2004 09:09:39 -0700, dm**********@yahoo.com (dmiller23462) wrote:
rs.Close
rs.Open SQLqry


All advice on my previous post was very helpful....Those pages are
working now....On to another issue I have now that's confusing the
stew out of me...

Sort of off topic (error code 8002009) but still the same pages....I
have the option of listing all Access db entries in the past
month/week/day/15 minutes and then also by a specific set of standards
input by the user doing the searching (user/wave number/shift,etc)The
problem I have with THESE pages is displaying records that have been
queried....If you take a look at my code you should get a good idea of
what I'm trying to do....

For some reason the page will display the fact that I have a total of
7 pages ("You are on page 1 of 7" for instance) and the first link
will come up the way it should (exact_wave_search.asp?pageNum=2) but
when I actually click on the aforementioned link (page 2) it actually
takes me back to the main search page of "exact_wave_search.asp" (my
html form) while displaying the address as
"exact_wave_search.asp?pageNum=2"....Huh? Here's the code, hopefully
I've explained myself now....

************
Start Code *
************

<!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
<%

Mode = request.form("mode")
Name = request.form("name")
Shift = request.form("shift")
Wave = request.form("wave")
Carton = request.form("carton")
Location = request.form("location")
License = request.form("license")
Sku = request.form("sku")
Qty = request.form("quantity")
Reason = request.form("reason")
Comments = request.form("comments")

Response.Write "<p><img border='0'
src='../../../../images/shortage_archives.jpg'></p>"
Response.Write "<p><img border='0'
src='../../../../images/search_by_shift.jpg'></p>"

'************************************************* ****************************
'* HTML FORM
*
'************************************************* ****************************
Sub Form()
Response.Write "<form method='POST' action='exact_shift_search.asp'
name='archive_d-or-n'><div align='left'>"
Response.Write "&nbsp;<table border='0' cellpadding='0' width='782'>"
Response.Write "<b>Shift</b> : <select name='shift'>"
Response.Write "<option>Day</option>"
Response.Write "<option>Night</option>"
Response.Write "</select></td>"
Response.Write "<input type='submit' value='Search by Shift'
name='search'>"
Response.Write "<input type='hidden' name='Mode' value='Send'>"
Response.Write "</form>"
End Sub
'************************************************* ****************************
'* END HTML FORM
*
'************************************************* ****************************

'************************************************* ****************************
'* DATABASE QUERY
*
'************************************************* ****************************
Sub Query()
If IsEmpty(Request.QueryString("pageNum")) Then
curPage = 1
Else
curPage = CInt(Request.QueryString("pageNum"))
End If

'create db connection
Set dbconn = Server.CreateObject("ADODB.Connection")

'open db in a DSN-less method
dbconn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage.mdb")

'create recordset object
Set rs = Server.CreateObject("ADODB.Recordset")

'specify more info about rs
rs.CursorLocation = 3
rs.CursorType = 3
rs.PageSize = 3

'sql statement to return input values drawn from html fields within
previous week
SQLqry = "SELECT * FROM shortage WHERE shift = '" & shift & "' ORDER
BY date DESC"

'display results of statement on screen for testing purposes
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

rs.Open SQLqry, dbconn
rsPageSize = rs.PageSize

If Not rs.EOF Then
rs.AbsolutePage = curPage
Response.Write "<p>You are on page: " & curPage & " of " &
rs.PageCount
Response.Write "<br>"
Response.Write "<br>"

rsRecordsShown = 0

Do While rsRecordsShown < rsPageSize and Not rs.EOF
Response.Write "<b>Name :</b> " & rs("name")
Response.Write "<br>"
Response.Write "<b>Shift :</b> " & rs("shift")
Response.Write "<br>"
Response.Write "<b>Wave Number :</b> " & rs("wave")
Response.Write "<br>"
Response.Write "<b>Carton Number :</b> " & rs("carton")
Response.Write "<br>"
Response.Write "<b>Location :</b> " & rs("location")
Response.Write "<br>"
Response.Write "<b>License :</b> " & rs("license")
Response.Write "<br>"
Response.Write "<b>SKU :</b> " & rs("sku")
Response.Write "<br>"
Response.Write "<b>Quantity :</b> " & rs("qty")
Response.Write "<br>"
Response.Write "<b>Reason :</b> " & rs("reason")
Response.Write "<br>"
Response.Write "<b>Comments :</b> " & rs("comments")
Response.Write "<br>"
Response.Write "<b>Date Submitted :</b> " & rs("date")
Response.Write "<hr>"
rsRecordsShown = rsRecordsShown + 1
rs.MoveNext
Loop

ElseIf rs.EOF Then
Response.Write "<h3><b>I'm sorry but no records were found matching
that description!</b></h3>"
End If

If curPage > 1 then
Response.Write "<a href='exact_shift_search.asp?pageNum=" &
curPage-1 & "'>Previous</a>"
If curPage < rs.PageCount then
Response.Write " | "
end if
end if
If curPage < rs.PageCount then
Response.Write "<a href='exact_shift_search.asp?pageNum=" &
curPage+1 & "'>Next</a>"
end if

'close recordset
rs.Close

'zero out recordset object
Set rs = Nothing

'smack around the db connection until it lets go
dbconn.Close

'terminate db connection with extreme prejudice
set dbconn = nothing
End Sub
'************************************************* ****************************
'* END DATABASE QUERY
*
'************************************************* ****************************

If Mode <> "Send" Then
Call Form
End If

If Mode = "Send" Then
Call Query
End If

Response.Write "<title>Shortage Archive File</title>"

Response.Write "<br><a href='../Archives.asp'>Return to Archives</a>"
Response.Write "<br><a href='../../Shortage.asp'>Return to Shortage
Submission Form</a>"
Response.Write "<br><a href='../../../default.asp'>Return to Warehouse
Operations</a>"

%><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
************
End Code *
************
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dmiller23462 | last post by:
Hey guys, I'm back again....I've got the results displaying that I wanted but instead of having a "next" or "previous" link displayed I am getting the error msg below (I actually get the data that...
2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
6
by: Tony | last post by:
Dear All, When I run an example program on the http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3 ...
13
by: lgbjr | last post by:
Hello All, I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If the user wishes to open or edit an image, I need to save the image in the picturebox to a temp file, then...
1
by: Jake Barnes | last post by:
I can not figure out the meaning of this error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://www.bluecasts.com/pdsIncludes/pdsAjax.js ::...
2
by: vasu1308 | last post by:
Hi all I am working on a socket program in Perl. Main goal is to develop a proxy server. Here is the code attached. An error is encountered. Anyone Please help me out. #!/usr/bin/perl -w #...
0
by: Tamer Ibrahim | last post by:
Hi, Sometimes, I got the following error message when I use ajax calendar control on some aspx pages : Object reference not set to an instance of an object. Description: An unhandled exception...
1
by: jimgym1989 | last post by:
I dont get it..why is the error: Exception in thread "main" java.util.InputMismatchException this is my code /** * @(#)textFileRead.java * * * @author * @version 1.00 2008/10/17 */
4
Manikgisl
by: Manikgisl | last post by:
hi, we have developed one application.That will download a zip file from ftp to enduser machine,,, For download a file from ftp ..we are using "Wininet API" to download But its not working...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.