Paging Access DB Records
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
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 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'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
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
I want to make a page that loads some records from access db and once i click on click on a button it goes and loads the rest of records. Just like the pic in the
url below. I be happy if some one show me an example on how to do it .
View Replies
View Related
Is there a way to GROUP records from an MS Access database?I'm using Dreamweaver Ultradev 4.0-programming in VB Script.Macromedia says that stored procedures aren't available when using MS Access (Only MS SQL) and Grouping isn't available using MS Access.Id like to query the database and group the records like so
Category A
-- Item 1
-- Item 2
-- Item 3
Category B
-- Item 5
-- Item 6
-- Item 7
i believe there's a way to hand code the query to work with MS Access.
View Replies
View Related
Anyone know if it is possible to update/insert a database record into a dynamically specified field.
The code I have here holds data in an asp session, ownerId, storeid and product type.
I can insert a record into the Productcat table, fields OwnerId and surfboards, no problem.
But what I would like is to insert the ownerid then insert poduct type into the field sepcified in the session variable (session("prodtype")) and/or strprodtpye
For Example
Insert OwnerId + product type into productcat into fileds ownerId and field labled ''strprodtype'' (variable, surfboard, wetsuit, boots, etc)
SQLstatement = "INSERT INTO Productcat (Ownerid,'"&strprodtype&"') "
I have tried using different methods, but the closest I got was IIS error msg ='field not found ("Surfboards", "wetsuits", "boots", etc)' Code:
View Replies
View Related
I have a single table.
ID Code Description Colour Qty
1 0001 T-Shirt Black 5
2 0002 Soccer Ball Red 1
3 0001 T-Shirt Black 2
4 0001 T-Shirt Navy 6
What I need to do using ASP is take record 1 and merge it with record 3. By this I mean I need to show only a singular qty for the product code 0001.
i.e.
ID Code Description Colour Qty
1 0001 T-Shirt Black 7
2 0002 Soccer Ball Red 1
4 0001 T-Shirt Navy 6
View Replies
View Related
Is it poss to move records from one table to another using ms access db to arcive records and how would i do that.
View Replies
View Related
I have an ASP file that retrieves records from an Access database and displays them in the browser. The problem is that the records come out unsorted. I need to sort them by entry date. I have a field in the table called "EntryDate" that is in the format MM/DD/YYYY. Can I sort by this field? If so, what would the SQL statement be?
View Replies
View Related
i've googeled to find a asp-script that can compare all the records in two
different access databases the mdb's have exactly the same tables what i want is that (the output) all the differences comes in a html-table in a webpage can anybody help me, are give me a example ?
View Replies
View Related
I have an access db from which I would like to display records in a formatted manner. I can display all the records one after the other on one page no problem, but I would like to display maybe 6 records on one page (3 across, 2 down). I would then need a page break for printing purposes.
Displaying all the records on one page would be fine if I can put a page break in so that they print correctly. I currently have it fomatted correctly, but my loop is not working correctly. Instead of different records displaying, I have 6 of the same record displaying, then the next record displaying 6 times, etc.
Even if it's better to do this over multiple pages, that would be fine as long as I can print the report with all records by clicking Print only once. Maybe even display the records on multiple pages with next and previous buttons, but when the user clicks print, then it would print a report from access.
I hope this all makes sense. Does anyone have any ideas or suggestions or pointers on the best way to do this both for viewing and printing purposes? Code:
View Replies
View Related
I made an asp that I insert records in an MS Access Database. I do insert them allright. But I want to check before inserting if this customer already exists. I try to do that by checking lastname and name (p_eponimo and p_onoma) but seems not to work ....
View Replies
View Related
how to do a dnsless connection to an access database and then insert records. The database name is members and table name is member_info.
View Replies
View Related
I am adding simple records to a fairly simple access database with the following code
rsEntry.Fields("Player1") = ShortName(Player1)
rsEntry.Fields("Player2") = ShortName(Player2)
'Write the updated recordset to the database
rsEntry.Update
rsEntry.Close
adoCon.Close
Set rsEntry = Nothing
Set adoCon = Nothing
How can I SIMPLY :-) prevent duplicate records from being added? I know I can set the index property on the fields but that mean handling the errors - not sure how to do this.
OR I could write the code to seach the DB before update - which may be the only way :-(
Is there a simple way?
View Replies
View Related
I'm trying to display records from an MS Access DB (*.mdb) in an ASP page (table).. I don't want to display all the records though, I just want to display the total of these records..i.e in my table I would like to show how many calls someone has closed this year..(number)
Joe Bloggs ---> 100 Closed
Is this possible? I was thinking that I need to write an ADO that includes COUNT but I'm not too sure how to write this.. Here's what I have so far: Code:
View Replies
View Related
I am trying set up a page where the user can view records chosen by the year.
I want to use a dropdown menu/list. Having trouble figuring out the sql behind this.
My db table has about 10 fields in it, one of which is the year this record was created. i want the enduser to be able to enter the page, and first step is to select a year to view. Again, i want this to be chosen using a drop down menu. After clicking I would like the page to show a simple table pulling up all the records from that year.
i know this sounds simple enough, but i cannot find this info/tutorial anywhere.. you guys are my only hope.
View Replies
View Related
We have an ASP site that hits up an Access database of categories of
products and products. (e.g. Categories = Napkins, Tablecloths;
Products = 20x20 Napkins, 21x21 Napkins, 54x54 Tablecloths, 60x60
Tablecloths)
We currently have select boxes that when you select a category, it
populates the next select box with the proper list of products (i.e. I
select Napkins as a category, I get a listing of the Napkins)
We would like to put a clickable link before each of these select
boxes that would pull up a pop up with links from the records from the
proper table.
(e.g. I click the categories link and a popup with html
anchor tags of Napkins and Tablecloths appear) I click on the Napkins
anchor and it populates the Categories Select box with Categories and
Napkins being selected.
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
I am working on a database based web page that has paging. I'm not getting error message, but it is not working at all. Let me tell you what it is not accomplishing and what I want it to accomplish.
1.) I want it to only display 20 records per page. It is currently displaying all records at this time.
2.) I want the numbers of page to be reduced. I don;'t want it to show all of the pages. I would prefer that it show something like next 10 after about 20 numbers.
You can find my code. It's lengthy. I have attached a document to let you see what I don't like.
Code: ....
View Replies
View Related