Solved

Search and Report page Using asp

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using YubiKey with REST API application 2 106
groupSum6 challenge 6 76
parse convert xml feed to text (python) 2 67
Apps blocked by Java 9 59
This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now