ASP Search Database

Reply

Join Date: Oct 2006
Posts: 13
Reputation: Goitse is an unknown quantity at this point 
Solved Threads: 0
Goitse Goitse is offline Offline
Newbie Poster

ASP Search Database

 
0
  #1
Feb 23rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 79
Reputation: nikkiH is an unknown quantity at this point 
Solved Threads: 4
nikkiH's Avatar
nikkiH nikkiH is offline Offline
Junior Poster in Training

Re: ASP Search Database

 
0
  #2
Feb 23rd, 2007
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.
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: Goitse is an unknown quantity at this point 
Solved Threads: 0
Goitse Goitse is offline Offline
Newbie Poster

Re: ASP Search Database

 
0
  #3
Feb 26th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 4
Reputation: bsvnhll is an unknown quantity at this point 
Solved Threads: 0
bsvnhll bsvnhll is offline Offline
Newbie Poster

Re: ASP Search Database

 
0
  #4
Oct 10th, 2007
retrive the Data from database store it in a Recordset and pass the search criteria in the quiry to search the records .
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: ASP Search Database

 
0
  #5
Oct 20th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC