Print Page | Close Window

How to find record from MS Access using ASP

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=19899
Printed Date: 29 March 2026 at 8:42am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: How to find record from MS Access using ASP
Posted By: tamakuwala
Subject: How to find record from MS Access using ASP
Date Posted: 16 May 2006 at 1:48pm
Hello,
 
I am trying to find data from my database. In my database, I have made up auto generate ID which will increment whenever data will insert from XHTML form. But now what I want to do is that if any use write ID in search field , that data should come up on the screen and user can modify it and save again to database.
I have written a query as well but nothing working properly.
If any one know any website or having these kind of code , please upload it asap...Cry
 



Replies:
Posted By: Scotty32
Date Posted: 12 June 2006 at 12:25pm
if you want to get the details of a record just do


Dim intRecordID

intRecordID = Request.QueryString("ID")
if isNumeric(intRecordID) then intRecordID = clng(intRecordID) else intRecordID = 0

strSQL = "SELECT * FROM Table_Name WHERE ID = " & intRecordID & ";"
rsCommon.Open strSQL, adoCon
if rsCommon.EOF or rsCommon.BOF then
     Response.Write("record not found, Try again")
else
     Response.Write("Record Found, Display Info")
end if
rsCommon.Close



this will display a record where the ID matchs the ID in the database
to display a different record your page address would look like:
page_name.asp?id=1

change the parts in red to suit your needs


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net