Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 08-28-2011, 03:54 PM   #1
Join Date: Feb 2011
Posts: 4
Default Filter page by ID or by Last Record inserted

Hi guys,
using DW CS5, asp & access i make a page filter by ID using this code

Dim rs__MMColParam
rs__MMColParam = "1"
If (Request.QueryString("field") <> "") Then
rs__MMColParam = Request.QueryString("field")
End If

but this page i use non only for reach data filter by id, but as page that can get the last record insert, instead to create another page for this...

How i have to do to get 1 page by ID or by last record?
Ciombe is offline   Reply With Quote
Old 10-12-2011, 04:08 PM   #2
Join Date: Oct 2011
Location: London
Posts: 4

I don't think you can get a page by ID or last record but you can certainly get a page that is sorted by ID and is also the last record:

I use the following code on a bar website in conjunction with a repeat region to show the full list of coctails, normally I'd 'ORDER BY Price DESC' but for your purposes 'ORDER BY ID ASC' should do the trick ( try DESC if ASC doesn't do it for you )

Dim cocktailsRS
Dim cocktailsRS_numRows

Set cocktailsRS = Server.CreateObject("ADODB.Recordset")
cocktailsRS.ActiveConnection = MM_databaseConn_STRING
cocktailsRS.Source = "SELECT * FROM TableMenu ORDER BY ID ASC"
cocktailsRS.CursorType = 0
cocktailsRS.CursorLocation = 2
cocktailsRS.LockType = 1

cocktailsRS_numRows = 0
YuleBLucky is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:41 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.