473,805 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.QuerySt ring("PagePosit ion") = "" Then
intRecordPositi onPageNum = 1
'Else the page has been displayed before so the news item record
postion is set to the Record Position number
Else
intRecordPositi onPageNum = CInt(Request.Qu eryString("Page Position"))
End If

Set rsGallery = Server.CreateOb ject("ADODB.Rec ordset")
gallerySQL = "SELECT fld_picture_fil eName, fld_picture_alt Tag FROM
tbl_pictures ORDER BY fld_picture_Dat eTime DESC;"
rsGallery.Open gallerySQL, objConn, adOpenKeyset, adLockOptimisti c,
adCmdText

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

'Get the record postion to display from
If NOT rsGallery.EOF Then rsGallery.Absol utePage =
intRecordPositi onPageNum
'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.Recor dCount

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

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_fileNam e") &
"_thumbnail.jpg ' alt='" & rsGallery("fld_ picture_altTag" ) & "'>" & _
" </td>"
If rsGallery.EOF Then Exit For
rsGallery.MoveN ext
Next
Response.write _
"</tr>"
If rsGallery.EOF Then Exit For
rsGallery.MoveN ext
Next
Response.write "</table>"
End If

'Paging code here

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

'If there are more pages to display then display links to all the pages
If intRecordPositi onPageNum > 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 = intRecordPositi onPageNum Then
Response.Write "&nbsp;<strong> " & intLinkPageNum & "</strong>"
Else
Response.Write "&nbsp;<a
href=""/NewSite/photo_galleries .asp?PagePositi on=" & 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;&n bsp;<a
href=""/NewSite/photo_galleries .asp?PagePositi on=" &
intRecordPositi onPageNum + 1 & """>Next&nbsp;& gt;&gt;</a>"
End If
Response.write _
" </td>" & _
"</tr>" & _
"</table>"
rsGallery.Close
Set rsGallery = nothing
%>

Jul 22 '05 #1
0 1219

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

Similar topics

10
3237
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 into another table on a remote server. The below code only inserts 1 record. How do I change the code to get all records inserted? thanks! <% Dim DataConn2 Set DataConn2 = Server.CreateObject("ADODB.Connection")
32
3232
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 lost when they move to a new record. This seems to be the case when there are multiple users. When there is a single user using it, we don't seem to have that problem. It seems that we had this problem when we first converted from an MDB back end...
2
2592
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 returning the full recordset. If the Like Nz() function is used on 1 field, it returns the correct number of records. As soon as I add it on more then one field, it loses records somehow. ??? For example, SELECT .GlossaryID,...
13
3488
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 query: QryICTMassDistribution3) , I then use a form and the code below to create a new record in the corrispondence table to show what corrispondence has been sent to various companies.
10
6735
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 contains only tables. I have linked the tables for the front end to the back end database. I am trying to set the recordsource of a form to a query established by the user to narrow the scope but I don't want to display the form if there are no...
6
2781
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 frontend separately from a backend. The tables from the backend database are linked in the frontend database. In the frontend there is a Form with a listbox in it. The listbox rowsource is a query that selects all the records from a (linked)
4
8680
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 adodcAllEntries.Recordset.Delete End If
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10103
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.