Paging Problem - Odd Number Of Records...
I'm trying to set up a "simple" page to display six items at a time in a 2 col x 3 row grid I've succeeded in doing this and displaying all the records but am struggling to only display six at a time I've searched on recordset paging and no one seems to cover this sort of problem Anyone any ideas? Code:
View Replies
ADVERTISEMENT
I'm having a bug here that is driving me nuts
I read more than 10 tutorials so far about paging records using ASP and Access, and all of them are basically using the same way I am, but no one seens to have this bug:
When I page my records, instead of listing ordered, the records shown on each page seens to be sort of compressed in a resumed search. Humm, let me try give an example:
The DB has 40 rows and Im using rs.cursorlocation=3, rs.pagesize=10, rs.cachesize=10
I do a search ordered by the field called 'name'.
Instead of showin on first page A-G, second page G-M, etc.., the list is showin A-Z on each page skiping the records. like "resuming" the seach in each page. And the other weird thing is that as I go from page to page the number of records start changin from 10, to 8 to 5
Does anyone ever had a bug like that?
View Replies
View Related
I am trying to develop a page where users can click on alphabets to look for a company name that starts with the selected letter.
Searching through the forums i came across the method of using DoCmd.
alpha = Request.QueryString("alp")
if alpha <> "" then
DoCmd.ApplyFilter "", "[com_name] Like ""[" & alpha & "]*"""
end if
The 'alpha' variable here holds the alphabet selected by user from another page. However, I'm getting an error message saying
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'DoCmd'
Initially i tried the usual filtering
if alpha <> "" then
rs.Filter = "com_name LIKE " & alpha
end if
The pages are suppose to display records in 10s. But instead of showing only the records of company starting "A" (example) it shows everything.
then, i was told in the forum that DoCmd is not used with ASP. Is there any other way?
View Replies
View Related
I have a page that returns a query onto a page 30 at a time. At the bottom are the navigation controls, back, next, etc. Printing it becomes a problem. I don't want the controls printed with the rest of the information.
Is there a way to keep them from printing or can they be moved to a seperate page in the frameset?Can the results be sent to the printer in a formatted manner without being displayed?
View Replies
View Related
I am trying to provide a paged listing of Access DB table data using ADO. I have a problem using the AbsolutePage method. I am using the following:
[VBS]
objRs.Open strSQL, objDbConn, adOpenStatic, adLockReadOnly, adCmdText
objRs.PageSize = 5
objRs.CacheSize = 5
objRs.MoveFirst
objRs.AbsolutePage = 24
Response.Write(objRs.AbsolutePage)
Do While objRs.AbsolutePage = 24 And Not objPubRs.EOF
Response.Write(objRs("data"))
objRs.MoveNext
Loop
[/VBS]
The line "Response.Write(objRs.AbsolutePage)" writes "-1" and the loop does not write any data.
If I remove the "objRs.AbsolutePage = 24 And" from the loop test it will write recordset data starting with the proper page position but continues to the end of the recordset (including all following pages).
With objRs.AbsolutePage reporting -1 I cannot test out of the loop based on the recordset page number.
View Replies
View Related
I am displaying my records horiztonally and i have set a limit on the records to be shown on my page the limit is 5 records per page and i have a category which has 8 records.
the code was working fine with paging when the records were displayed vertically but when i added the code so that it displays horizontally its giving this error Code:
View Replies
View Related
I am having a problem with my recordset paging. It does not crash however no records are viewable. It shows no information from my database.
It shows that there are 8456 pages and the href links and thats it.
I also did a response.write(mysql) response.end to check that my sql was correct. It is picking up the correct sql except no information. Code:
View Replies
View Related
I'm trying to only show 10 records at a time. I have the first 10 records showing. The problem is that when I click the Next button I get an error message: ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. Also different people are going to search for different things so there will always be a different amount of records returned each time. I can't figure this out. My code is:
View Replies
View Related
Any build in function that can calculate number of records in a table?
View Replies
View Related
I have a results page which retrieves a number. I am using "Repeat record" to get a list of all the number records of the database.
I would like to make a sum of all these records at the end of the result page.
record1 = 100 (repeat region)
record2 = 500
record3 = 100
and then, how can I make a sum of these records?
Total = 700
View Replies
View Related
how to query data which spesific the number of record from 'start' to the 'end'?let say i have 20 records,then i only wanto to query record from row number 10th to 16th like that.
View Replies
View Related
I just want to return the number of records in a database:
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT COUNT(*) FROM alumni_baby"
cn.Open ("dsn=mssql;database=web;uid=aaa;pwd=aaa;")
rs.Open sql, cn
%>
<% Response.Write (sql) %>
But that spits out the sql statement, not a number. What am I doing wrong?
View Replies
View Related
I want to know the number of records in my database when performing a query by sql. I am getting -1 as number of records.
<%
connectme="DSN=hotel"
sqltemp="SELECT Count([All Rooms].Engaged) AS CountOfFREEROOM FROM [All Rooms] GROUP BY [All Rooms].Engaged HAVING ((([All Rooms].Engaged)=False));"
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.open sqltemp, connectme, adopenstatic
howmanyrecs=rstemp.recordcount
response.write howmanyrecs & " records in<br>" & sqltemp
rstemp.close
set rstemp=nothing
%>
my project is on an online hotel reservation. I want to have the number of rooms available each time the page loads.
View Replies
View Related
how do I display only n number of records? then create links to the next set of n?
View Replies
View Related
how can i get a total number of filtered records? what's the code?
View Replies
View Related
I have built and app where people can add records to a database the problem is while the next page is loading some people are impatient and click refresh adding another same record with slightly different time stamp.
Is there anyway to limit the number of records insterted to my SQL database from my asp pages to one.
View Replies
View Related
i need to go through a list of items and check to see if items on list 1 are on list 2 and vise-versa. so im going to look at item 1 on list 1, and go through all the items on list 2. if i find a match, ill update the record on list 1, if i dont find a match ill update the record on list 2.
im going to need a nested loop. in c++ i know how i could do this, but im not sure as how to do it in vbs/asp. can you do for each "record" in "myrecordset"? or do i have to get the number of records in the table and run the loop that many times? which would be eaister?
View Replies
View Related
I'm trying to specify how many records to be display per page. I put a limit of 40 records and i'm getting only 2 per page. The number of pages it seems ok but the records displayed are only 2 instead of 40. Code:
View Replies
View Related
I have an articles_tbl . How do i create a select statement which only brings back the latest 3 records added to this table (the database has a field called 'date_added') so the information of when they were added is present.
I was just wondering how to bring back only THREE records and showing them, instead of bringing back the entire table content and then showing three out of them..
View Replies
View Related
how can i Count and display number of records in table?
View Replies
View Related
I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
View Replies
View Related
here is the scenerio
in master batch table i have various master batch like
200701-0001
200701-0002
200701-0003
Now each master batch can have multiple final mixed batch like
200701-0001-01
200701-0001-02
200701-0001-03
and this record is inserted in to fmix table.
so i have a form in which i have a dropdown menu in which all the master batch is listed,
i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,
how to achieve this
so in short each master batch will have more than one final mixed batch.
pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.
View Replies
View Related
I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.
How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?
View Replies
View Related
The problem concerns 2 tables, cart_products and cart_shoppingcart.
Cart_products contains all the product data (eg, prices, product's key name, etc), but most importantly, it contains the quantity of stock (prod_quantity) for each item.
cart_shoppingcart contains all of the user's items in their shoppingcart, including those that are part of an (customer) order; these have the order_number to differentiate from those that aren't in any order (their Order_number is 'no_order', the others have the order number).
Now, what I want to do is this:
For every item in the order (ie, every entry in cart_shoppingcart that matches the username and order number), take the quantity (x) the customer is ordering, then take the quantity of stock remaining (y), then subtract x from y to create the new stock level (z) and update the appropriate record in cart_products with z (all this with SQl preferably).
I was thinking of using a Do while loop, but realised that it wouldn't work as I'd have to use several SQL statements and then I'd run into a problem the minute ASP reads "objrec.movenext".
View Replies
View Related
I'm trying to pull the last 5 records from my database.
<% j=5
rs.MoveLast
While ((j>0) AND (NOT rs_article.BOF))%>
''Execute HTML and data insertion here
<%rs_article.MovePrevious
j=j-1
Wend%>
Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic.
Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.
View Replies
View Related
I have an Access database with two fields that I would like to group by. The two fields are location and department. Field names are "Location" and "DeptName".
I have the code correct for grouping by location. That code looks like this: Code:
View Replies
View Related
Is there a way of using the ALT outside the IMG? I was wondering if it's possible of using an ALT on paging # to show which page is at what record. This is what I have though it doesn't work: Code:
View Replies
View Related
I was wondering if any body can kindly help me with a little dilemma I have.
ASP and SQL paging was relatively easy to implement, however, I cannot manage to get start the paging from a certain record:
In the script that I made, about 4,000 pictures get displayed as thumbnails in paged view, when users click on a thumbnail they are taken to individual picture view, with “next” and “back” controls, however, I cannot find a way of returning the user to the thumbnail view that starts with the picture they just viewed, and not the beginning of the recordset.
View Replies
View Related
I have a database table with field as a three digit number like 001 (I did that because when I was searching for example 1, it would bring all the numbers which included 1, like 1, 10, 11, 12...100...). I have the following so far: Code:
View Replies
View Related
I'M using paging in my application.
I have separated my pages by 50 records per page.
Now, lets say Iwant to sort by name only 50 records
that exist in page 3 for example(lets say page 3 is the
currently displaying page). How can i achieve this.
Because as it is my sql sorts all the table(all pages)
and a specific record that was in page 4 maybe
in page6 for example.
View Replies
View Related
I do done paging of first previous next last but now i want the paging in displaying page number. i.e. if there is 25 pages then display only 1 2 3 4 5 .... and if click on number the page will be display and next five will be apper on screen
View Replies
View Related
I have an asp page that I would like to do paging. The problem I'm running
into is that the same page that prints to the output is also recieving data
from the previous page for query parameters for the sql string.
When I click on the next page, it queries itself and loses all the query
parameter information from the parameter page and brings back all the
records.How can I keep the parameter values from the query form and still advance to
the next page?
View Replies
View Related
I am building up a search engine with .ASP 3.0 using sql server database for data listing and what I Like to do is display max 10 items in one page per search query and have Prev and Next to display pages with informations requested and found in recordset. sort of like google.
View Replies
View Related