| | |
ASP Search Database
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
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
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.
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/
Bored? Visit http://www.kaelisspace.com/
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
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.
/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.
![]() |
Similar Threads
- Asp.net-Database example- About snippets (DaniWeb Community Feedback)
- ASP Advanced Search (ASP)
- Import excel records into ASP database (ASP)
- need help, to Search from database (ASP)
- Tutorial: Search a Database (ASP)
Other Threads in the ASP Forum
- Previous Thread: "Masking Real Address" on adress bar
- Next Thread: can asp work with mySQL
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7






