Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performing a Query with Hyperlinks and ASP ...

Status
Not open for further replies.

croag

MIS
Nov 8, 2001
49
US
Hello,

I'm using an Oracle DB and asp 3.0 to perform some quick little queries. I've got the db stuff down ( I think!!) I would just like a little help with the following 2 questions.

#1)

I need to be able to click on a hyperlink of a letter of the alphabet and using asp, return the records in the DB that begin with the coresponding letter to that same page.

#2)

This is where I'm debating between two options. 1) would it be better for the results from #1 above to be returned as hyperlinks or as option buttons. I'm not sure which is better and/or more appropiate.

Any help would be great,

Thanks a mil,

T.J.
 
by clicking on hyperlink, we can run the query using query string

eg

<a href=&quot;results.asp?search=a&quot;>A</a>

and now accept it as request.querystring

 
The next step would be to do your SQL stmt in results.asp
If you use the LIKE statment to compare your field against the letter that was passed then it will give you all the records that match your criteria:
&quot;SELECT * FROM []tablename[/i] WHERE fieldname LIKE '&quot;&Request.QueryString(&quot;search&quot;)&&quot;%'

The percent here acts as a wildcard, basically telling it to match any record that starts with a and has 0 or more of any character after it.

Concerning #2, I would probably go with links just because it looks cleaner then a column of buttons.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
I have to have the radio buttons, it's a design spec!!! (ARRRGH) should I just do a DO UNTIL objrs.eof from the records that are returned? On that same note, I having a though time deciphering on how about using multiple forms on a page,
#1 On the first form would give me info based on a hyper link and

#2 the second form ( on the same page) would let me chose (via radio button) which on of those results ( from the hyper links) I wanted.

#3 Then the data would be passed to the next page.

Thanks for any help,

T.J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top