473,399 Members | 3,888 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,399 software developers and data experts.

Losing records in recordset??

I'm guessing this has something to do with my cursor but I'm not sure.
this is for a picture gallery app and when I upload pictures some
pictures or records don't show up. this is what ia have so far. any
thoughts? this only works with an adOpenKeyset cursor by the way. use
any others any it spits out errors.

thanks!!!

<%
'If this is the first time the page is displayed then set the record
position is set to page 1
If Request.QueryString("PagePosition") = "" Then
intRecordPositionPageNum = 1
'Else the page has been displayed before so the news item record
postion is set to the Record Position number
Else
intRecordPositionPageNum = CInt(Request.QueryString("PagePosition"))
End If

Set rsGallery = Server.CreateObject("ADODB.Recordset")
gallerySQL = "SELECT fld_picture_fileName, fld_picture_altTag FROM
tbl_pictures ORDER BY fld_picture_DateTime DESC;"
rsGallery.Open gallerySQL, objConn, adOpenKeyset, adLockOptimistic,
adCmdText

'Set the number of records to display on each page
rsGallery.PageSize = 16

'Get the record postion to display from
If NOT rsGallery.EOF Then rsGallery.AbsolutePage =
intRecordPositionPageNum
'If there are no pictures in the database display an error message
If rsGallery.EOF Then
'Tell the user there are no pictures to display
Response.Write "There are no pictures to display"
Response.End
Else
'Count the number of pictures in database
picCount = rsGallery.RecordCount

'Count the number of pages of pictures there are in the database
calculated by the PageSize attribute set above
galleryPage = rsGallery.PageCount

Response.write _
"<table cellspacing='5' cellpadding='0' border='0'>"
'For....Next Loop to display pictures in the database
For rowCounter = 1 to 4
If rsGallery.EOF Then Exit For
Response.write _
"<tr>"
For cellCounter = 1 to 4
If rsGallery.EOF Then Exit For
Response.write _
" <td valign='top'>" & _
" <img src='/NewSite/thumbs/" & rsGallery("fld_picture_fileName") &
"_thumbnail.jpg' alt='" & rsGallery("fld_picture_altTag") & "'>" & _
" </td>"
If rsGallery.EOF Then Exit For
rsGallery.MoveNext
Next
Response.write _
"</tr>"
If rsGallery.EOF Then Exit For
rsGallery.MoveNext
Next
Response.write "</table>"
End If

'Paging code here

Response.write _
"<table border='0' width='100%'>" & _
"<tr>" & _
" <td align='center'>"
If intRecordPositionPageNum > 1 Then
Response.Write "<a href=""/NewSite/photo_galleries.asp?PagePosition=" &
intRecordPositionPageNum - 1 &
""">&lt;&lt;&nbsp;Prev</a>&nbsp;&nbsp;"
End If

'If there are more pages to display then display links to all the pages
If intRecordPositionPageNum > 1 or NOT rsGallery.EOF Then
For intLinkPageNum = 1 to galleryPage

'If the page to be linked to is the page displayed then don't make it
a hyper-link
If intLinkPageNum = intRecordPositionPageNum Then
Response.Write "&nbsp;<strong>" & intLinkPageNum & "</strong>"
Else
Response.Write "&nbsp;<a
href=""/NewSite/photo_galleries.asp?PagePosition=" & intLinkPageNum &
""">" & intLinkPageNum & "</a>"
End If
Next
End If
'if this is not the last page display
If NOT rsGallery.EOF then
Response.Write "&nbsp;&nbsp;&nbsp;<a
href=""/NewSite/photo_galleries.asp?PagePosition=" &
intRecordPositionPageNum + 1 & """>Next&nbsp;&gt;&gt;</a>"
End If
Response.write _
" </td>" & _
"</tr>" & _
"</table>"
rsGallery.Close
Set rsGallery = nothing
%>

Jul 22 '05 #1
0 1203

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

Similar topics

10
by: shank | last post by:
I have a recordset that contains multiple records of product a user is purchasing. For clarity, I converted the recordset fields to variables. I need to take that entire recordset and insert it...
32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
2
by: Jennifer | last post by:
I have a query with 5 possible criteria via a form. If criteria is not entered, I use the like Nz() function on the backend query to use an "*" for criteria fields left blank. The query is not...
13
by: Jan | last post by:
Hi I have a database that I use to keep track of the sales promotions that we send to companies. I normally send a mailing based on a subset of the companies in the database (found using the...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
6
by: gerbski | last post by:
Hi all, I am relatively new to ADO, but up to now I got things working the way I wanted. But now I've run into somethng really annoying. I am working in MS Access. I am using an Access...
4
by: felicia | last post by:
Hi All, Below is my code to delete records: adodcAllEntries.Recordset.MoveFirst Do While (adodcAllEntries.Recordset.EOF = False) If adodcAllEntries.Recordset.Fields(0) = selected_id Then...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.