Solved

Search and Report page Using asp

Posted on 2006-06-19
3
253 Views
Last Modified: 2010-04-17
I would like to create a search page with 2 values that gets dynamic list of values from an access database and then pass the result to a report page

Please how can I achieve that.

Urgent.
0
Comment
Question by:iolike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
lostcarpark earned 500 total points
ID: 16939046
I think you might get more help if you were more specific in your question. Why is it urgent - because you haven't bothered to start your homework assignment for the last two weeks, and now it's due tomorrow?

What have you got so far? Where are you stuck? Are you using plain old ASP or newer ASP.NET? This can make quite a big difference to how about creating your solution.

In very general terms:

1. You need to creae a search form to allow a user to enter their search terms and initiatea search.
This could be a very simple HTML form which is submitted to an ASP page, or it could be an ASP.NET form with validators performing client-side checking.

2. Depending on the complexity of your form, you may need to validate it and get the user to fix any invalid entries (and check for hacking tricks like SQL insertion).
Again, this can be done with simple ASP code or validators or your own JavaScript. If you implement client-side validation you should never rely on it as anything on the client side can be tampered with. Always back it up with server-side validation (though validators generally handle both).

3. You need some code to accept the values in the form and build a query to run against your database.
This is often just a matter of concatinating strings together to build up some SQL that you send to the database.
For example:
    Dim sql As String
    sql = "select FirstName, LastName, Address from Customers where LastName like '*" & toFind & "*' "
This will create a piece of SQL to find all customers that contain the letters in the variable toFind in their last name. This assumes that toFind has already been parsed for things like quote characters that would allow hackers to insert SQL code and potentially get a free reign on your database.

4. You need some more code to receive the results of the query and present them to the user.
Again, there are many ways to do this. In old ASP, it's generally a case of using Response.Write statements to format the query results in a table. In ASP.NET, the easiest solution is to bind the resultset to a data grid, and let it do most of the work for you.

That should get you most of the way there. If you can tell where you're getting stuck, I'm sure lots of people will be only too happy to help.

Best of luck,

James
0
 

Author Comment

by:iolike
ID: 16944322
Thank you for your answer, FYI it is urgent because the budget season is here and I need to clean up someone else's mess, and being new to Asp I needed help
0
 
LVL 5

Expert Comment

by:lostcarpark
ID: 16944465
Sorry if I was a bit harsh, but the more specific your question, the easier it is to give a helpful answer. With something like this, knowing how far you've got alreadycan make all the difference.

Best of luck,

James
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Part One of the two-part Q&A series with MalwareTech.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question