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:)

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.

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

retrive the Data from database store it in a Recordset and pass the search criteria in the quiry to search the records .

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.