codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Database search problem  stevemw at 10:40 on Thursday, July 01, 2004
 

Hi there,

I'm very new to ASP but due to a deadline given to me at work I've had to try and learn fast with the help of sample code etc.

I have a knowledge base database with three tables, two of which are used for lookup purposes on the main "Problems" table. I have designed a form on a web page which can be used to add records to this database. I also have an asp page which displays these records in pages. However, I am struggling with the search form. The SQL statement to display all the records in the database is:

SELECT Problems.id, Problems.error, Categories.Category, Programs.Program, Problems.description, Problems.resolution FROM Problems, Categories, Programs WHERE Categories.CategoryRef = Problems.categoryref AND Programs.ProgramRef = Problems.programref

I have designed a search form where the user specifies the error, category, program and some keywords. I want to pass these details into a SQL statement similar to the below.

SELECT Problems.id, Problems.error, Categories.Category, Programs.Program, Problems.description, Problems.resolution FROM Problems, Categories, Programs WHERE Categories.CategoryRef = Problems.categoryref AND Programs.ProgramRef = Problems.programref AND Problems.error LIKE FormErrorField AND Categories.categoryref = FormCategoryField AND Programs.programref = FormProgramField AND Problems.description LIKE FormKeywordsField AND Problems.resolution LIKE FormKeywordsField

I'd then like it to either display on th same page or feed the resulting SQL statement into another asp page similar to the one I use to display all records.

I've seen various ways of doing this but have been unable to customize the examples I have found to my needs (maybe I'mjust trying to learn too fast but I'm on a deadline and have to). I need to get this done within a week and am struggling a bit. I can provide the files for the site I've already done if necessary.

Hope I've made some sense.

Many Thanks

Steve


  Re: Database search problem  stevemw at 12:17 on Thursday, July 01, 2004
 

I've adapted some code I found and it seems to be ok. However, when I submit the query it just refreshes the screen instead of displaying the table as specified. Any ideas? I've tried pasting my code into this query but it tries to resolve the code instead of displaying it as text.

Thanks

Steve







CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Help with WYSIWYG editor
•  Help with WYSIWYG editor
•  C# QueryString Encryptor HTTPModule
•  Re: Database search problem
•  HTML Launch .exe direct
•  Re: Set up file Down Load
•  Re: Help: Trouble with z-Index and SELECT lists
•  Getting file in same format into iframe
•  Re: Arbitrary attributes on div


Recent Articles
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)
Function to Return Alpha Characters Only
The OSI Reference Model - A Clear and Concise Illustration !
Understanding Pointers to Functions in C
Application & Session Events in the Global.asax File
Socket Programming in Perl


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2004