ASP Database Search

I'm having a problem with a simple search. I have a telephone directory where people can search by first or last name. This works great but when someone tries to search for a name with an ' in it you get an error.

Here's my code for the database connection:Code:

sql = "SELECT Staff.[first_name], Staff.preferred_name, Staff.no_location,
Staff.[last_name], Staff.[location], Staff.business_title, Staff.department,
Staff.phone, Staff.fax, Staff.[email]
FROM Staff WHERE (((Staff.[last_name])like'%"
& Request.QueryString("[search-lastname]") & "%')) "

I'm certain it's just a syntax error so hopefully someone can spot it quick. Using a - in the name search doesn't bring the error.

View Replies


ADVERTISEMENT

Database Search;

I have been thinking about this wee problem for a while now, and usually I figure out what I need to do, but in this case I'm drawing a blank And the most annoying thing is that I don't think it should be that hard! I use this code to search a database: Code:

View Replies View Related

Using ASP To Search A Database

My setup is going to be like this:

I have one page that has a few categories on it. When the person clicks on one of the categories it sends the querystring to the next page. That page takes the query string, searches the database and only replies with found results. Thats what I'm trying to setup, I think I'm very close.

I know the request.querystring is being sent properly and receieved properly, because I also have it's name displayed on the next page and that works fine. I know my connection to the database is okay, becasue if I just set it to display the entire database that will display fine.

It's when I try to use the Request.QueryString that was sent to search the database - it returns like it can never find anything. The page displays, no asp or coding errors - just no information.

The database Column I'm trying to have it search is called "Classification". I think that's all the info.. if I'm missing something you need to know let me know. Code:

View Replies View Related

Database Search

Does any one know of any good asp database search scripts. What I'm looking for it to search the database on different criteria or phrases. Eg Kane 400 Boiler.

The user could put in kane 400 and it would pick it up, basically something that you don't have to put in the search how it appears in the database, I have worked on this and works fine if you put the exact phrase in, or one work but if i put in kane 400 it does not work. Also if I put % it lists the whole database, this database will hold 10000 > products so want it not to be to heavy etc.

View Replies View Related

To Search A Database

I'm trying to use information that a user enters into an HTML form to search a database. For example, if a user clicks on a check box stating their interests are 'holidays' then this information needs to be used to search the database for entries that match, ie the entry has a category that states it is about holidays.

The entries in the database are linked to pictures that will then be loaded onto a website.

View Replies View Related

Search Database With ASP

I've created a search bar on my site to search a database with job information. I dont know what i am doing wrong, i just want what the user types in to display after pressing search. I thought all i would need is Code:

View Replies View Related

All Database Fields Search

I am looking for an ASP script that let me to serach all database contents with only one textfield in search page. eg: I have a database with five columns for lessons: Mat, physics, geography, history and sport. Each field have numbers 1 thr 5. I want to search only those students have number eg:3. with entering the number in textfield in serach page. I have no problem in result page.

View Replies View Related

Search Function W/out A Database?

I would like my ASP-based site to have a search box to bring up a list of relevant pages according to user-defined search criteria.

Q: Do I need to have a d/b like SQL Server 7 at the back end to process and match the search string? Or can I do w/out a d/b somehow and run a search, and somehow still bring up the same results?

If a d/b isn't necc, pls. advise on webpages where I can find such ASP-search codes.... TQ!!

View Replies View Related

Access Database Search With ASP

I have built a small cms driven website using asp and access database. There is nothing special about it, it has about 5 tables each containing unique data.

I want to add a search field on all pages which will search the entire database and present the results.

I have been searching for hours now and cant find a script that suits my needs. Can anyone point me in the right direction or reccomend a script?

View Replies View Related

Database Search Function

I have a page that uses the data from the previous pages form to search the data in the database and dispaly any matching results.

On doing so i get this error:

Error Type:
Microsoft VBScript compilation (0x800A03F9)
Expected 'Then'
/IT/searchresults.asp, line 20, column 15
If Request.Form"(Typesearch") = "computer_name" Then

My statement has a then in the statement already.

View Replies View Related

ASP Access Database Search

I'm having trouble figuring out how to do a freetext search in my ms access db table. Code:

View Replies View Related

Should I Use LIKE Or InSTR For A Database Search?

Which is better practice?

Code:
Select * From groups Where groupName LIKE '%bli%' AND cusType LIKE 'CUST%'
or

Code:
Select * From groups Where InStr(groupName,'li')>0 AND InStr(cusType,'CUST')=1
Right now I'm using and Access database but plan to upsize to a MSSQL if that makes any difference. Are there any advantages or disadvantages to either technique?

View Replies View Related

ASP Search W/ Access Database

I would like to get asp code for searching database.I have data in Ms Access. I want to search by catagories. A dropdown list to choose to narrowdown search. If keyword found, create a hyperlink of the location so that easy to view.

View Replies View Related

Keyword Database Search

I have been searching for a way to search a database based on keywords. All I can seem to find is google searches. All I want to search is my own database.The db contains inventory for a friends store. As list is long he would like to be able to search an item based on item name, supplier, or type.

View Replies View Related

Search On Database Tables

I want to do a searching on database some tables' content, is asp have so function or tool to do this?

View Replies View Related

Search More Than 1 Database Table At Once

Im looking for a means to allow the search criteria provided by a user to be checked against fields in more than one recordset table in a ms access database.

Is there a means within asp to check multiple tables at the same time using one set of criteria? So far the only solutions i've seen to this includes the usage of a list box which dictates which recordset is opened. I would like to avoid this.

View Replies View Related

Database Column Search

I am looking for a asp script, that will do an OR search on keywords in two differant columns in an MySQL database. for example if someone searches for joe bloggs I want to bring back all records that have either of the words joe or bloggs in column one or column two.

I have found a script that does exactly what I want but it will only search one column of a database whereas i would want it to search two columns. http://www.4guysfromrolla.com/webtech/052799-1.shtml

how to modify this code or point me in the direction of some other code that will do the same job.

View Replies View Related

Search A Word In Whole Database

I'm trying to find a Sql query to find a word in all the data of all tables of an microsoft access DataBase.

View Replies View Related

Database Driven Search Engine

Does anyone know where I can find a free simple script to create a search engine using Access Database backend and will allow the user to type in a word (not a using drop down list) and it will search the table.

View Replies View Related

Combobox Criteria For SQL Database Search

I have a combo box in an ASP page, there are 7 lists total in the combo box, there is another text box on the page and a search button. I want the users to select an item from the combo box and type a keyword and click search.

The combo item and keyword will be used as an criteria to query a SQL database. I'm familiar with SQL connection and running queries but how do I take the criteria and pass on further.

View Replies View Related

Search Database By Date Problem

I want a user to search for records between 2 dates.

The database is a msaccess db has a date column ( format type is date). This is filled with the date (date()) at the time of submitting.

I then have a search page this has simple drop down lists to select the two dates. The code for this is: Code:

View Replies View Related

Database Exact Keyword Search

i am doing a database search project. and i would like to know how do i get exact keyword searched from the database. for e.g. if the user enters keyword as "lan" to be searched it should return only records that contain exact keyword "lan" and should not return "plan" and other words like that.

View Replies View Related

Search Multiply Database Columns

i want to search several colums in a table with a keyword. but i'm new to asp/vbscript and so far i've only done basic recordsets... can any one help?

(btw - i'm a pixel pusher and tech talk tends to baffle - i've tried reading about UNIONS and JOINS but ... woooooo we'll leave it there...)

i can search one column like so...

SELECT * FROM tbl_products WHERE col_make LIKE '%" & Request("keyword") & "%'

but how to i search for...

SELECT * FROM tbl_products WHERE col_model LIKE '%" & Request("keyword") & "%'

at the same time ??

View Replies View Related

Search MySQL Database Query

I'm creating a database search page and the table I want to search has fields linked to other tables in the database. For example, the job table has a number of fields, 2 of which are area and job type which are tables in the database. My search page has option for searching by job title, job type and job area (via dynamic drop-down).

Do I need to create a recordset for each referenced for the dynamic drop-downs to work?

View Replies View Related

Need Data In Database Be On Search Engines.

I want to have a list of businesses stored in a database. When some one does a search, a list will come up with a few businesses shown according tot he search criteria.

When one of the businesses is clicked on from the resultant list, the
details of the business are shown.

I want the contents of the database to appear on search engines.
I can't see how this would be possible if I am drawing that information
out from a database?? Code:

View Replies View Related

Passing Database Search Parameters

I am trying to do any better than this and am losing my confidence daily as I pressumed this to be easy and I am sure once I have done it I will wonder what all the fuss was about!

My experience with ASP is limited to one Degree module and I am trying to build a prototype web site. I need pointing in the right direction to what I presume is a common ASP requirement - a ‘second level of user enquiry’. Code:

View Replies View Related

ASP Search Using Query In Access Database

I have an Access database that I created a query in. The query brings fields from related tables and prompts users to perform a search based on 3 criterias.

NOTE: the prompts can be bypassed by just leaving it blank and selecting OK. So in other words, the user does not need to fill in each prompt for the search to work, it just give them a more narrowed down search if they fill more in...

Now for the ASP part... I want to create an ASP page where the use selects from 3 drop downs. These drop downs are named the same as the field names in my query. How do I get this to work??

View Replies View Related

Asp Database Search Form Submission Problem

im working on a database driven website that uses an access database of links and search keywords that users can search through to find a particular page within my site. the search box is in a table and the results come up in an iframe without the page refreshing aside fromt the iframe itself. at the moment when i type a search into the text field and press enter the results come up as i want them to within the iframe.

however if i press the search button next to the text field section of the form as opposed to pressing enter the database does not find any results yet the no results found error still appears within the iframe. i have tried the same searches and pressed enter and they work but as soon as i try to click the search button they do not.

here is the search form code so any of you geniuses out there who can help me can see if any code is missing: Code:

View Replies View Related

How To Search A Database Field From Form Input

How to search a database field from form input? is it easy to do i like to have a html form from an html page that will call an asp page to do db search, if user enter a zipcode that match in the database it will pull all the infomation from both talbes and display on the screen

i have 2 tables related to each other
contact table
id, fname, lastname, contactid, email

zip table
id, zip, contactid, city

View Replies View Related

How To Search A Database Field From Form Input?

How to search a database field from form input? is it easy to do i like to have a html form from an html page that will call an asp page to do db search, if user enter a zipcode that match in the database it will pull all the infomation from both talbes and display on the screen

i have 2 tables related to each other:

contact table id, fname, lastname, contactid, email

zip table
id, zip, contactid, city

View Replies View Related

Search Access Database Using Short Date

I have a database and i want to work out the sum of the discount field where the id is lets say 1 and the date is greater than 01/02/2006

The database hase records older than 01/02/2006 but I dont want them just the 1s dated 01/02/2006 to now

set RS3 = conn3.execute("select SUM(discount) from restaurantaccounts WHERE restaurantid=1 AND datepaid >=01/02/2006").

View Replies View Related

Retrieving Information From Database Using Multiple Search Criteria

I am trying to search for clients contained within a database using multiple search criteria that the user is able to select using a front end form.

The user is able to select there criteria by selecting one or more check boxes and the results are thus retrieved based on what the user has selected. The search works fine until you try and select multiple client types Code:

View Replies View Related

Need To Convert Google Search Ref To Find What The User Search

i get the ref url that come to my site and i want to convert it to find
out what was the query in (google or other searcher sites)

foe example : if someone goes to google and search some text and my
site was in his resaults and he click on it , in my site i see his link
ref like
http://www.google.co.il/search?hl=i...91-Google&meta=

i want to know (in asp and save it to DB) what was the word or words
that the user write in search engine.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved