Author |
Topic  |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 25 May 2001 : 15:03:34
|
I have been geeting this error message when there are no items that are "Pending". Here is the errormessage: quote:
Microsoft JET Database Engine error '80040e0e' Invalid bookmark
/purchaseorder/admin/POID_Pending.asp, line 74
Here is my code: <%@ language="VBScript" %> <!-- #include file="adovbs.inc" --> <% Response.Buffer = True %> <HTML> <HEAD> <TITLE>Title</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF">
<% Dim strQuery
'Create an instance of the Connection Object Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
'Create the Connection to the Database DatabaseConnection.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=E:\databases\PurchaseOrder.mdb;"
'Create a recordset object Set recSet = Server.CreateObject("ADODB.Recordset")
'specify the source and open the recordset strQuery = "SELECT I2POs.POID, I2POs.Name, I2POs.EmailAddress, I2POs.Cost, I2POs.WhenSent, " & _ "I2PODepartments.DepartmentName, I2POs.Decision FROM I2PODepartments " & _ "INNER JOIN I2POs ON I2PODepartments.DepartmentID = I2POs.DepartmentID WHERE (I2POs.Decision = 'Pending') ORDER BY POID;"
recSet.Open strQuery, DatabaseConnection, adOpenStatic, adCmdText
If recSet.BOF and recSet.EOF Then Response.write "<BR>" Response.write "<BR>" Response.write "<BR>" Response.write "<BR>" Response.write "<BR>" Response.write "<P Class=""Special"" ALIGN='center'>Sorry!<BR><BR>No items available for this catagory at this time.<BR><BR>Please check back.</P>" Else
'specify the number of records per page recSet.PageSize=10
'get current page If not isEmpty(Request.QueryString("pageno")) Then pageno=Request.QueryString("pageno") Else pageno=1 %> <H1 ALIGN="center">PENDING REQUISITION ORDERS</H1> <DIV ALIGN="CENTER"> <TABLE WIDTH="600" CELLSPACING="1" CELLPADDING="5" BORDER="0"> <!-- begin column headers --> <TR> <TD WIDTH="50"><IMG SRC="images/pixel.gif" WIDTH="40" HEIGHT="1" ALT="Spacer" BORDER="0"></TD> <TD WIDTH="130"><IMG SRC="images/pixel.gif" WIDTH="120" HEIGHT="1" ALT="Spacer" BORDER="0"></TD> <TD WIDTH="160"><IMG SRC="images/pixel.gif" WIDTH="150" HEIGHT="1" ALT="Spacer" BORDER="0"></TD> <TD WIDTH="120"><IMG SRC="images/pixel.gif" WIDTH="110" HEIGHT="1" ALT="Spacer" BORDER="0"></TD> <TD WIDTH="140"><IMG SRC="images/pixel.gif" WIDTH="130" HEIGHT="1" ALT="Spacer" BORDER="0"></TD> </TR> <TR BGCOLOR="#104F8F"> <TH Class="special">ROID</TH> <TH Class="special">Submitted By</TH> <TH Class="special">Department</TH> <TH Class="special">Price</TH> <TH Class="special">Submitted On</TH> </TR> <% recSet.AbsolutePage=pageno 'cycle thru the page set and display five records at a time For intRecord=1 To recSet.PageSize %> <TR BGCOLOR="#EEEEEE"> <TD class="special"><A HREF="purchase_order_decision.asp?POID=<%=recSet("POID")%>"><%=recSet("POID")%></A></TD> <TD class="special"><A HREF="mailto:<%= recSet("EmailAddress")%>"><%= recSet("Name")%></A></TD> <TD class="special"><%= recSet("DepartmentName")%></TD> <TD class="special"><%= recSet("Cost")%></TD> <TD class="special"><%= recSet("WhenSent")%></TD> </TR> <!-- next record=next table --> <% 'increment record position with MoveNext method recSet.MoveNext If recSet.EOF Then Exit For Next %> </TABLE> </DIV > <% links="<P ALIGN=""center""><FONT FACE=""Verdana, Arial"" SIZE=""2"">" For page=1 To recSet.PageCount links=links & "<A HREF='POID_Pending.asp?pageno=" & page & "'>Page "&page&"</A>" If page < recSet.PageCount Then links=links & " | " Next links=links & "</P>" response.write links 'close the recordset and flush object from memory recSet.Close Set recSet=Nothing End if
%> </BODY> </HTML>
A sample of the databas is located at http://www.media-2000.com/purchaseorder.mdb
Your help is appreciated.
Thanks,
Mo |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 25 May 2001 : 20:07:12
|
Strange!! I used the same code on a differnt server and worked like a charm.
Thanks,
Mo |
 |
|
MorningZ
Junior Member
 
USA
169 Posts |
Posted - 25 May 2001 : 23:26:19
|
Why wouldnt you do a
Do While not recSet.EOF blah blah output recSet.MoveNext Loop
??
that way you will never have the .EOF of the set cause you grief ( cause i am guessing it is trying to movenext when there is nothing there )
( btw, how long did it take you to format that message so the code looked presentable, heh heh ?? )
 |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 26 May 2001 : 00:48:55
|
quote: ( btw, how long did it take you to format that message so the code looked presentable, heh heh ?? )
Steve, workin' on a Friday nite too?
You are aware of the [ code ] [ /code ] tags, right? 
Mo, I think but I'm not sure that you need to move through the current page in your recordset by absolute position, not a 1 to pagesize. So you'd need to start the loop at absoluteposition=(pageno * pagesize) and go to ((pageno * pagesize) + pagesize). Just a guess, tho.
====== Doug G ======
Edited by - Doug G on 26 May 2001 00:49:45
Edited by - Doug G on 26 May 2001 00:52:37 |
 |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 26 May 2001 : 11:04:02
|
Stop picking on me guys. Hey for a guy my age what else I'm supposed to do on Friday nite. But thanks for the tips anyway and will let you know how it goes. BTW, I used the [ code ] [ /code ] tags.
Thanks,
Mo |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 26 May 2001 : 14:26:06
|
quote: Steve, workin' on a Friday nite too?
You are aware of the [ code ] [ /code ] tags, right?
Well, this was for MorningZ :)
====== Doug G ====== |
 |
|
|
Topic  |
|