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
ADVERTISEMENT
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
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
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
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
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
View Related
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
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
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
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
Is there a way in ASP to enter a link and if the link works, it will search the page for a keyword. If the keyword is found, it displays a result.
For Example:
Keyword: Dog
Page: URL
I need something to go to URL page, grab the html, search it, and tell me if "Dog" is on the page or not.
View Replies
View Related
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
how to make a site search. I want to search all the pages on my site for a specific word. For example i would like to know what pages whose bodies contain the word "help".
View Replies
View Related
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
I have a page that displays results of a database query that is paged to 5 records per page and i have some very messy code for the navigation.
Firstly i have a "First/Previous/Next/Last" navigation set then i have direct page numbering which is limited to 10 pages and as you move through the pages the page numbers change depending where you are in the page set.
If that makes any sense.
i.e. if you are on pages 1 to 5 it shows pages 1 to 10, if you then go to page 10 it shows pages 5 to 14 etc.
This all seems to work quite well, not sure how but it dose.
What i am having problems with is the URL's the links point to as the page can have various parameters. the URL always calls the same ASP page but the parameters can be different.
example:
Page.asp (default page)
page.asp?page=5 (default but on page 5)
page.asp?user=userID&page=5 (page with specific user and on page 5)
at the moment there is only the user parameter apart from the pages but this could change.
I need to be able to build the URL's for the links dynamically so it includes all previous parameters from the existing page but then changes the page number when navigating through the pages.
Anyone got a good solution to this one, i keep hitting a snag with the parameter separator whether to use ? or &.
View Replies
View Related
I am unable to access an Access database through a webpage I built, but only if the database is on a server running Windows NT 4.0 Server. If I copy the database to
a pc using NT Workstation then there is no problem. I have a user account set up on the sever as IUSR_pcname. It is a domain user with full privileges. This is the connection code:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=10.10.10.10pcdTEST.mdb;"
It gives me a 'disk or network' error and for some reason, and the server locks out the IUSR_pcname account after I try.
View Replies
View Related
I have a two dropdown lists (Job Catogory and Sub Job Catagory). The values are populated from the database in the following manner, when a user chooses a particular job catagory from the Job Catagory list, the corrosponding sub job catagories are populated into the Sub Job Catagory list. I am using asp as the server side script and sql server as the database. Now whats happening is that when a user chooses a particular job catagory, the form reloads and thn only the sub job catagory list is populated. Is there anyway that this can by done without reloading the page. Probable using a combination of asp and javascript
I posted the same problem in XML forum as someone told me that this can be done through it.
View Replies
View Related
I developed an ASP page which has 2 input fields- First Name and Last Name.I used Access 2002 as database. Once I click the Submit button,
it has to perform 3 tasks-----
1) It has to update the First Name and Last Name in the MS-Access database in their corresponding fields.
2) It has to go to the Home Page(which I already did)
3) It has to update the date/time in the "Time" field in the MS-Access database.
The following is the code I wrote to connect to the database and update the fields in the Access table---
<%
set MyConn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.RecordSet")
MyConn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=c:/documents and
settings/adcguest/desktop/webpage_html
ewsecurity.mdb;"
rs.Open sqlqry,MyConn,2,2
rs.AddNew
rs("firstname") = first name
rs("lastname") = last name
rs.update
rs.close
myconn.close
%>
Can somebody please help me in figuringout if I am missing something.
View Replies
View Related
Dim id
If (id = "") then
id = Request.QueryString("id")
End If
If (id = "") then
id = 1
End If
I use a QueryString request function, so when an id is called, that page loads into the current one. This is perfect, however if say the user directly types a link into the url, like index.asp?id=999, then basically the code is flawed, it breaks up.
Secondly if say a page has been erased from the database, and the link still is available, the code is equally flawed, so it would be good to have a page in my id, say id=50 that displays a page with data from the database, explaining that the page you are trying to reach did not exist or no longer exists, because so far, I get a page error:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/mjhw/functions/functions2.asp, line 21
But how can I over come this.
View Replies
View Related
I have created a asp project local.and have created a access database local. Iam trying to use the access database from the asp page. But It is not accessing the database file.
once i changed the rights of the access file and checked it.It inserted the records.And after some time, iam not able to access it.some times it accesses and some times it doesnt.
View Replies
View Related
I have a question on DB Connection. My ASP requires me to create 2 DB connections to 2 different database.
2004.mdb & Information.mdb. In this 2004.mdb, I have 12 tables(tbl1,tbl2...tbl12).
And in Information.mdb, I have a table called t_information. This table houses all the names of tables from 2004.mdb.
In my ASP page, there is a drop down list. As you can guess, this drop down list retrieves the values from table t_information that resides in Information.mdb.
When I select the table that I want to display & click the submit button, I will have to create connection to this 2004.mdb that has all the tables(tbl1..tbl12) and display the selected table. Am I right? So, to achieve the displaying of the selected data, I have to create connection to both 2004.mdb & Information.mdb right? Is that possible? I mean, can I really create/establish these 2 database connections on the same ASP page?
I really need advices on this people. Do hope to see replies here. And I understand that we can TableDef in Access? Can anyone explain to me what does TableDef do? And how to go about creating it?
View Replies
View Related
I can display information to a webpage from a database and handle the connections etc. My next task is a bit more complicated for myelf. Id like to have a page the pulls information from a record set and displays like this.
down one side
the container numbers
along the top
the products in the containers
the information in the middle would be the amount of product that came on that container.
Im just wondering how the best way to setup my database would be, and the best way to setup the asp webpage. (oh) nearly forgot, it has to repeat the information till all the records are finished but i guess that gos without saying.
View Replies
View Related
I tried using the following statements to transfer to html and asp page but i could not
response.redirect("&results('Url')&")
or
Server.Transfer(results("Url"))
pls tell me how can i transfer to html and asp page that i get its url from database...
View Replies
View Related
I wrote a script to compact my access databases from my admin section. Everything is working except I get this error:
Provider error '80040e4d'
Authentication failed.
Is their some reason the JRO.JetEngine needs authentication? I don't have direct access to this server and was wondering how to get around this problem or how to fix it. It fails when this link is run:
objJetEngine.CompactDatabase strCon, "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & DBTempPath
None of the databases have a username or password. Would I have to have the host company setup an account for this action to take place? And why could I do everything except compact the database? Is their a vulnerability issue when accessing this function?
View Replies
View Related
i got an error saying file not found 404 when redirect to html page
and i ensure that the file is found in the same directory and in the database :
response.redirect results("Url")
where Url is the column name in the database that contain the page name.
View Replies
View Related
i wanna connect front page forms with the database for searching and updation .. how can i do it.. in asp it ask to host the web it doesn't works on disk drive..any one help to solve this proplem..any alternative
View Replies
View Related
how to stop sending data to the database when refreshing the page,i use access database with asp,all the time that i refresh the page same data goes to the database again and again
View Replies
View Related
i have 25 data in the database, each of this data i will assigned them to be displayed in an 5*5 table(asp page), that means, each data assigned to one cell in my table.
but if the data inside the database is not 25, thats means in my timetable, there will be one cell thet is empty and this page cannot be view since i am trying to displays an empty database!
View Replies
View Related
i am updating client's table(i.e insert one new client) from one asp page and after that it is being redirected to html page on that page i have one link which selects records from client's table and then displays it in the form of list. The problem is that when a new client is added it is not shown in the list. If anyone can please guide me on how to refresh the asp page after every database updates.
View Replies
View Related
I show information from a database in a table format. I will be showing more and more data and would like to show it one page at a time with a next page back page option.
Can I do this on a web page and does anyone know where I could look to find out how
View Replies
View Related
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
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
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