944,008 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 3689
  • ASP RSS
Feb 23rd, 2007
0

ASP Search Database

Expand Post »
Hi everyone

I have been studying ASP and I seem to be getting the hang of it. I recently just did an application that adds new equipments to the database. Now my problem is that I'm trying to include a button which will search the database and retrieve the required results.

I have tried using ASP.Net,but it is totally not working. So I was hoping if anyone can help me with the ways to go about using ASP.

Everyone enjoy the rest of the weekend.

Thanks in Advance

Bye
Similar Threads
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Goitse is offline Offline
13 posts
since Oct 2006
Feb 23rd, 2007
0

Re: ASP Search Database

You have a current application written in Classic ASP, and you want to add to it?
Where do you want the search button, and how do you want the results displayed?
If you already have an ASP app set up, you can use the same connection object and just make a recordset that runs your query.

I can give you example code from Northwind if you like, but I need to know how you want it displayed. ASP.NET has neat things like a datagrid, Classic ASP you have to do it all yourself.
If you have Dreamweaver, it can make Classic ASP coding a lot easier.
Last edited by nikkiH; Feb 23rd, 2007 at 11:28 am.
Reputation Points: 13
Solved Threads: 4
Junior Poster in Training
nikkiH is offline Offline
79 posts
since Dec 2006
Feb 26th, 2007
0

Re: ASP Search Database

I want the search button to be in the same application and include a textbox where users can find out from the database, the equipments that where bought on that particular date.

I want the format to be like the one I have provided below ;

New Equipments
Date
Equipment
Cost
19-Apr-07
System Unit
R 300.00
19-Apr-27
Keyboard
R 25.00

And by the way, I am using dreamweaver 8.
I hope that the information I have provided will be relevant and understandable.

Best Regards
Goitse
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Goitse is offline Offline
13 posts
since Oct 2006
Oct 10th, 2007
0

Re: ASP Search Database

retrive the Data from database store it in a Recordset and pass the search criteria in the quiry to search the records .
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bsvnhll is offline Offline
4 posts
since Oct 2007
Oct 20th, 2007
0

Re: ASP Search Database

Your best bet would be to post it back to itself with a hidden variable, or to post it to a brand new page. When you do, post it to like:

/search.asp?query=SearchText

Then pull the querystring by typing:
Dim strQuery = Request.QueryString("query")

Put that into the SQL statement as follows:
SELECT * FROM Database WHERE fieldtocheck LIKE '%" & strQuery & "%' ORDER BY Date DESC"

Then store the information into an array with getrows for speed:
arrResult = rs.GetRows() 'retrieves all rows, or specify for certain numer like rs.GetRows(25) for 25 results

Then display them below like this:
recMax = UBound( arrResult1, 2 )
For rec = 0 to recMax
'Do coding here
<table><tr><td>Result 1: <%= rs.fields("equipment") %></td</tr></table>
Next


This simply pulls the information from the database and stores it into an array from getrows (which is very fast), then spits it out into tables. The tables only display the equipment field. Edit as needed.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: "Masking Real Address" on adress bar
Next Thread in ASP Forum Timeline: can asp work with mySQL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC