D
dmiller23462
My brain is nuked....Can anybody tell me right off the bat what is
wrong with this code? Along with any glaring errors, please let me
know the syntax to display a message (Response.Write would be fine I
think) that will say "I'm sorry but the data you requested cannot be
found" or something along those lines....
This code is on an archive page I have on my company's intranet....The
end result is to show 3 records at a time pulled from an Access DB and
display on the screen....If the information IS found, everything seems
to work alright but if it's not I get the error msg listed....Instead
of that error msg I'd like to get the friendly message for the user
basically saying "Sorry but your info can't be found" (see
above)....Any help/suggestions would be great....I'm fried....In the
process of trying to improve my work I broke it....I'm a newbie to ASP
so please, hook a brother up with some advice...
My error message....
*****
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
/jax/wh/Online_Forms/Secured_Archives/search_files/search_results_wave.asp,
line 57
*****
My code from search_results_wave.asp....
*****
<!-- #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")
waveyear = request.form("waveyear")
wavemonth = request.form("wavemonth")
waveday = request.form("waveday")
wavenumber = request.form("wavenumber")
'*****************************************************************************
'* DATABASE APPENDING
*
'*****************************************************************************
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
rs.open "shortage", dbconn
'sql statement to return input values drawn from html fields within
previous week
SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
waveday& wavenumber&"'"
'display results of statement on screen for testing purposes
Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"
'execute SQL statement
'Set db = dbconn.Execute(SQLqry)
rs.Close
rs.Open SQLqry
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
If rs.EOF Then Exit For
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
If curPage > 1 then
Response.Write "<a href='search_results_wave.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_wave.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
%>
<br><a href="../Archives.asp">Return to Archives</a>
<br><a href="../../Shortage.asp">Return to Shortage Submission
Form</a>
<br><a href="../../../default.asp">Return to Warehouse
Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
*****
wrong with this code? Along with any glaring errors, please let me
know the syntax to display a message (Response.Write would be fine I
think) that will say "I'm sorry but the data you requested cannot be
found" or something along those lines....
This code is on an archive page I have on my company's intranet....The
end result is to show 3 records at a time pulled from an Access DB and
display on the screen....If the information IS found, everything seems
to work alright but if it's not I get the error msg listed....Instead
of that error msg I'd like to get the friendly message for the user
basically saying "Sorry but your info can't be found" (see
above)....Any help/suggestions would be great....I'm fried....In the
process of trying to improve my work I broke it....I'm a newbie to ASP
so please, hook a brother up with some advice...
My error message....
*****
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
/jax/wh/Online_Forms/Secured_Archives/search_files/search_results_wave.asp,
line 57
*****
My code from search_results_wave.asp....
*****
<!-- #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")
waveyear = request.form("waveyear")
wavemonth = request.form("wavemonth")
waveday = request.form("waveday")
wavenumber = request.form("wavenumber")
'*****************************************************************************
'* DATABASE APPENDING
*
'*****************************************************************************
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
rs.open "shortage", dbconn
'sql statement to return input values drawn from html fields within
previous week
SQLqry = "SELECT * FROM shortage WHERE wave = '"&waveyear& wavemonth&
waveday& wavenumber&"'"
'display results of statement on screen for testing purposes
Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"
'execute SQL statement
'Set db = dbconn.Execute(SQLqry)
rs.Close
rs.Open SQLqry
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
If rs.EOF Then Exit For
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
If curPage > 1 then
Response.Write "<a href='search_results_wave.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_wave.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
%>
<br><a href="../Archives.asp">Return to Archives</a>
<br><a href="../../Shortage.asp">Return to Shortage Submission
Form</a>
<br><a href="../../../default.asp">Return to Warehouse
Operations</a><!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
*****