Searching Database Using An Array

I have the following code and nee to know how to make it return all records where sha is equal to any of the values in the array I have defined. Code:

View Replies


ADVERTISEMENT

Searching Over An Array

I have a single column that outputs a comma seperated list of values (black, white, red)
I created an arrary to output the values

Dim colorTypes, arrTypes
arrTypes = split(objRS("types"), " ")

riceTypes = REPLACE(objRS("Types"), ", ", "<Li>")
response.Write "<Li>" & colorTypes

This works fine. Now, I need to compare a queryString to arrTypes and bold the match before outputting it.

View Replies View Related

Searching In Database

I need help in retreiving data from database. my form consists of some checkboxes,
for eg:- in my form for location three check boxes are there and for the type of house four checkboxes.(houses,apartments,offices etc).Below is my form,

London (north of river)
(checkbox here)Central London
(checkbox here) Docklands
(checkbox here)Ealing, Chiswick & Acton


Number of Bedrooms(text box here)

(checkbox here)Houses
(checkbox here)Apartments
(checkbox here)Developments & Land
(checkbox here)Commercial

My databse consists of all this information. If the user want 2 bedroom flat or apartment in central london he will check central london, 2 bedrooms, house and apartment. for this i need an sql query to retrieve from database the appropriate property they are finding.

View Replies View Related

Searching The Database

I have a code that compares the value in the textfeild of a form with the value in the database table

do until rsData.EOF
if trim(rsData("core_contact_fname"))=trim(request.form("txtNumber1")) then%>

i would like to do two things to it one is to compare the two values while ignoring their cases(ignore case) i am not sure how to use the ignore case function.

I also want it to comapre if i want to search for say"L" I should get all the names starting with L from the database.

View Replies View Related

Searching Database

I have a website running asp (about to move to asp.net soon though) which has a list of DVD's I have the various pages I want, last 10, listing, full listing ect, but the one page i can't figure out is a search page. I have read various books, but none have given any tips on how to make a search page for a access DB.

View Replies View Related

Searching A Database

I did a quick search on this (insert ironic comment) but cannot find anything appropriate. What I have is a site running out of an access database, holding roughly 150+ pages in the same format, i.e. a page header, content text, and the date it was published.

What I want to do is to have a search form where a user can insert keywords, and the search script then queries the database and pulls out links to the pages (or database entries, obviously) that match the query. I've tried another script but this only searches for .htm or .html files within the directory my site is housed in. Is there a tutorial/direction anyone can point me to in order to achieve this?

View Replies View Related

Page 2 - Searching Database Using ASP

I get the following error:

Command text was not set for the command object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Command text was not set for the command object. Code:

View Replies View Related

Searching A Database Using The Name Of Person

I want to search my database using a person's name. My names are separated into 'First' and 'Last' name fields.

The SQL I'm using so far works if you search only by the first name, or only by the surname, but if you enter both names, it comes back with no results.

How do you do it so that it will work in all cases?

Here's my code:

Sql = "SELECT * FROM kbs, authors WHERE authors.authorID = kbs.author"

If Request.Form("TypeSearch") = "author" Then
Sql = Sql & " AND (authors.authorLastName LIKE '%" & Request.Form("kbsSearch") & "%' OR authors.authorFirstName LIKE '%" & Request.Form("kbsSearch") & "%')"
End If

set rs = Server.CreateObject("ADODB.Recordset")
set rs=conn.execute(Sql)

View Replies View Related

Code For Searching A Database.

Basically i have one table and i want to search it by what the user types in the search bar/text box.

View Replies View Related

Searching Database Field

I want to search 2 of my database fields (title and description) for search terms entered in a form. I can do a 'LIKE' but how do I cover searching for each word in the string that has been submitted? For example, if someone searches for 'World Cup Final', I want to search both database fields for 'world', 'cup' and 'final'.

View Replies View Related

Searching All Database Tables

How can ASP be used to search through a database that has multiple tables in it? I want to be able to enter a string into a field in an ASP page and the resultant tables to be listed in a table or list on an asp page. It might be the same page or another. I know it can be done - but I can't link the concepts or code together.

View Replies View Related

Searching Database With 'phrase', 'allwords' Etc.

I'd like to give the visitor the option of searching my database entries, for: 'all words', 'the phrase', 'any word' etc. Code:

View Replies View Related

Searching Database With Multiple Text Boxes?

The user can search the database when they put in a date, that works fine, but when i put in another text box to search the database for a certain date range Code:

View Replies View Related

Database Into An Array

I have a database of Company titles that I want to grab from an access
database, put into an asp array and then pass it to javascript so I can
output it into a CSS styled javascript menu. Right now I am stuck on
how to exactly put the database entries into an asp array. Below is
what I have so far.

So I want it to return distinct entries from the
Title field and put it into the array called Titles after the asp code
has done an HTMLEncode to make sure I can also pass it along to another
asp page. Basically I need to know what to put after the Do While NOT
Rs.EOF. Code:

View Replies View Related

Form Into Array & Database.

What I need to do is to create a form of a dynamic size, and then save
everything from the form in a database. The number of forms depends on
a number from the database which I know how to get. I need to have a
comment and a number, for example if the number from queried from the
database is 2, then I need 2 forms, and it would be something like so:

Comment: Something
Number: 4

Comment: SomethingElse
Number: 6

When the user clicks the submit button, this would be saved in a
database in a table, in a new row. I have the database created and
inserting works very good when inserting just one row, but I need to
insert more then one row at a time, so it would be something like
this: Code:

View Replies View Related

Populate Array From Database

I need to populate an array with two columns of data from a database eg Firstname and second name and sorte alphabetically. So both of these columns go in to one array, I found this code.

View Replies View Related

Array/database Compare To Determine...

...selected value of select box.

...a select box.

I have a static array with 10 elements in it. I am trying to create an update form for a mysql database.

I want to get the info from the database to populate the field of the update form. My select box is populated by the array and I want the value that is stored in the database to be the "selected" element in the select box(= to array element). I hope this is making sense. Code:

View Replies View Related

Retrieving Array From Single Column In Database

I have about 26 checkboxes that place all of my contacts into categories so in my database for contacts i have a field called categories that contains all of the categeories that each contact belongs to seperated by a ",". 1,5,17 etc.

I need help getting these values out of the database so that when I user select category 17 they get all of the contacts that containg the 17 in their respective categories field.

View Replies View Related

Problem With Adding Array To Database Table

I have an array which I want to save into a database table I tried a few things but it doesn't work. This is as far as I got: Code:

View Replies View Related

Writing Array Of Random Numbers To A Database

I am trying to write an array of random numbers to a database. The array part is working fine, but when I go to update the dataabse, it inserts the last value of the array into all the fields in the database .....

Dim MyValue,sqlRandom
Dim arrayRandom(8)
for i = 1 to 8
Randomize
MyValue = Int((100 * Rnd) + 1)
arrayRandom(i) = MyValue
response.write "<p> Array Value:" & arrayRandom(i)

sqlRandom = "UPDATE CarParkDetails SET FreeSpaces = '" & arrayRandom(i) & "'"
Conn.execute(sqlRandom)

next

I can't see whats wrong!

View Replies View Related

Varying Number Of Database Columns Into Array

I have a DB that contains several columns named Line1, Line2, Line3, and Line4. After that I there are 50 columns named Data0 through Data49. Data0 and Data1 will always contain text but Data2 through Data49 may or may not be empty.

I am trying to take the values out of the database and put them into arrays. Since Line1 through Line4 never change I have no problem getting them into one array but I am lost on the logic/syntax on how to not only determine how many Data(n) cells are populated but then how to get them into a new array.

View Replies View Related

Matching Array Index To Values Retrieved From Database

I have this dynamic array(shown below) that I need to match to values (1 - 10) that I am returning from the database via DSN connection object.

The values I need to match are on the same page (in their own table) but I am not sure how to match up the array indexes to these values. I want to be able to display the array result as part of or nested in another table. Code:

View Replies View Related

Rebuilding Of An Array From An Existing Array

I dump the entire recordset into an array:

If not rs.EOF Then
aEmp = rs.GetRows()

Contents of the array are in this order:

EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName

This query sort on the basis of Lft and Rgt columns.

The name of the array is: aEmp.

My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.

Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.

View Replies View Related

Array Integers Vs Array Variables

In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.

Ex.

Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works

Code:

View Replies View Related

Searching In Var

I have some variables that consist of small paragraphs and or short sentences. How can I to see if a specific word is used in the text of that var.

View Replies View Related

Searching In ASP

i want to perform search operations using ASP.

this is a word search i.e. every word entered as search keyword
should be searched in the database...

since it is a word search, i tried to split the string entered as search keyword,
and then search for each splitted word in the database.

It worked for only a few records present in the database. some 1034 records were searched out of 1914 i tried the same procedure in PHP and that worked.

View Replies View Related

Searching With SQL LIKE

I'm having some problems using like to find items in my database for some reason its not finding anything if it has a space in it. Here is my SQL query:

SELECT * FROM Employees WHERE FirstName LIKE '%Dennis Smith%' OR LastName LIKE '%Dennis Smith%'

In this query i'm searching two fields for any occurance of Dennis Smith whom i know is in the database however no results are returned. Also if i just search one field and the search string has a space in it, no results are returned.

View Replies View Related

Searching Excel-

currenlty we are changing our user email ids- about 2000.I have an excel file with thier new and old email ids.

Is it possible to make a .asp form file and put in an IIS server.
where user enter their current id- and the asp returns the new email id.

View Replies View Related

Searching Databases

I'm trying to design a simple website with 2 dynamic searching functions. The first is the user enters text into a search box, clicks on the search button and then connects to a sql or access database and brings back those records that are LIKE the search phrase. It's my intention to then have a detailsview link on the searches so the user can drill through.I'm designing an online version of my catalog so that the user can browse by page. I also want the user to enter a page number and then click go and that would then take the user to the corresponding page in the catalog. I'm guessing I'll need to declare If 1 then open page1.html, if 2 then open page2.html.
I know I'm close but not close enough and my knowledge has been well and truly stretched and I must have read and read my Dummies book about 20 times over the last week.

View Replies View Related

Dictionary Searching

Just wondering the best way of doing this? are there any dictionary databases laying around somewhere?

I want to change my search so that it corrects typo's and maybe suggests better words to search with... like googles but with more alternative words to make the search more useful - slightly limited so it doesn't become pages and pages of search terms.

What I don't want to do is sit down in front of my computer and type all of this in, going through related words and possible other searches / best searches from the given input.

View Replies View Related

Searching Uploaded

A client uploads a document (a msword .doc file) to the server,
I need to search a string that document and find specific words in it
(this is an Application to a School, most of them look the same, so all you can do is replace the school name in the application, but sometimes people forget to do so and get rejected for sending inappropriate application).
So I need to find in each Application possible names of other schools and alert about it.

I'm writing in ASP (I can use ASP.net as well)
I DON'T HAVE ACCESS TO THE SERVER (it belongs to the hosting company, and there's no way of installing anything there)

View Replies View Related

Searching Access Db With Asp

I have a simple intranet for the company I work for and I am attempting to create a phone listing and search tool for it. The list has a simple 500 record access db.

Presently I have a page which displays the entire db. What I'd like to do is have a form at the top of the page that lists the entire db where a person could type in any word... Name, office location etc and have the result ported out on a new page with only items matching the search criteria. Code:

View Replies View Related

Searching A Field

I have a database which has a field called "title". I have made a text input box and set that user submitted text to a variable (call it textvar). How do I say something like this...?

Set rs = conn.execute("Select * from workitem where title contains '" &textvar& "' " )

Of course the word contains is just a guess on my part.. other ideas are "is like". What function/syntax will give me what I want, which is for it to return any title that has the words entered by the user?

View Replies View Related







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