Solved

Search and Report page Using asp

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Arduino EDI - Programming Language - Voice Recorder 4 95
ejb example issues 3 28
learn programming 8 42
Why use this lambda? 12 39
A short article about a problem I had getting the GPS LocationListener working.
A short article about problems I had with the new location API and permissions in Marshmallow
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 …

821 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