Solved

Search and Report page Using asp

Posted on 2006-06-19
3
251 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

739 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