One Click Search from a database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I search an Access database using just a hyperlink? For example, I
want to have a user get results from one field by clicking a link without a
submit button.
Thanks!
Brad
 
You would use a Query String, such as

myresults.asp?city=Newark

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Attach a query string to hyperlink, then read it using ASP and make a
lookup in the database.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
you'd have to base the query on a specific bit of information eg

<a href="search.asp?city=New York>List Records for New York</a>
 
I need a little more help please. How about if I use this example...

Link "Results for Minneapolis" from a field called "city",
From a database called "Leagues" and a table called "results".

What does my query string look like then?
Thanks all!
Brad
 
Your query string remains unchanged as
<a href="search.asp?city=Minneapolis>List Records for Minneapolis</a>

Your search.asp gets the query variable and must process it for the correct db/table/field

strCity = Request.QueryString("city")

strSQL = "SELECT * FROM results WHERE city ='" & strCity &"'"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, YOURDBCONNECTIONHERE

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I need a little more help please. How about if I use this example...
|
| Link "Results for Minneapolis" from a field called "city",
| From a database called "Leagues" and a table called "results".
|
| What does my query string look like then?
| Thanks all!
| Brad
|
|
|
| "Andrew Murray" wrote:
|
| > you'd have to base the query on a specific bit of information eg
| >
| > <a href="search.asp?city=New York>List Records for New York</a>
| >
| > | > > How do I search an Access database using just a hyperlink? For example, I
| > > want to have a user get results from one field by clicking a link without
| > > a
| > > submit button.
| > > Thanks!
| > > Brad
| >
| >
| >
 
I am using an Access database though and I'm having trouble to follow your
instructions. Arg.
 
Back
Top