Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Search Script
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Search Script

 Post Reply Post Reply
Author
Bliss View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2003
Location: United States
Status: Offline
Points: 181
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bliss Quote  Post ReplyReply Direct Link To This Post Topic: Search Script
    Posted: 03 August 2003 at 12:30pm
Can anyone show me a simple search script to search a field in an access database?
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2003 at 2:06pm
Just replace rsCommon with your database connection, strInputSearch with the search word or request.form variable, tblTableName with your actual table name, and Field_name with your actually field_name you are searching.

Code:

<%
strInputSearch = "Your search word or form variable"

strSQL = "SELECT tblTableName.* FROM tblTableName "
strSQL = strSQL & "WHERE tblTableName.Field_name LIKE '%" & strInputSearch & "%';"

rsCommon.Open strSQL, adoCon

If rsCommon.EOF Then
      Response.Write("No Records Found")
Else
      DO UNTIL rsCommon.EOF
             Response.Write(rsCommon("Field_name") & "<br>")
      rsCommon.MoveNext
      Loop
End if

rsCommon.Close
%>
Back to Top
Bliss View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2003
Location: United States
Status: Offline
Points: 181
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bliss Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2003 at 2:28pm
Thanx.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.