Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   ASP (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=187)
-   -   Filter page by ID or by Last Record inserted (http://www.dreamweaverclub.com/forum//showthread.php?t=41509)

Ciombe 08-28-2011 04:54 PM

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?

YuleBLucky 10-12-2011 05:08 PM

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

All times are GMT. The time now is 11:54 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com