Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - database search
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

database search

 Post Reply Post Reply
Author
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Topic: database search
    Posted: 07 August 2003 at 4:12am

Hi,

I have an access database on my asp page of records that have field names artist, title, year, label etc...

I want to be able to input a drop down box for artist, title and label and a text box for users to input a text string to search for and for the return page to show only results that match.

How would i go about this? I have no real programming knowledge, so the simpler the better :-)

thanks in advance!
mark

Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2003 at 4:42am

for the drop down list:

<form>
<select Name="Artist">
<option selected>Choose Artist</option>
<%
Dim rs2, MYSQL2
set c = server.createobject ("ADODB.connection")
set rs2 = server.createobject ("ADODB.recordset")
c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("./DBFolder/DB.mdb")

MYSQL2 = "SELECT Artist, COUNT(Artist) AS majorCategories "
MYSQL2 = MYSQL2 & "FROM TableName GROUP BY Artist ORDER BY Artist;"
rs2.open MYSQL2, c, 1, 3
While Not rs2.EOF
%>
<option value="<%= rs2("Artist") %>"><%= rs2("Artist") %></option>
<%
rs2.MoveNext
Wend

rs2.close
c.close
%>
</select>

 

 

 

this may help.



Edited by zMaestro
Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2003 at 12:19pm

hi many thanks for this,

i have inserted text but i get an error saying:

Microsoft JET Database Engine (0x80004005)
ODBC--connection to 'record_webtest' failed.

why would this happed?

Back to Top
3BEPb View Drop Down
Groupie
Groupie


Joined: 07 August 2003
Location: United States
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote 3BEPb Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 4:13pm

R U sure you changed database path to the actual this line:

c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("./DBFolder/DB.mdb")

 

Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 11:36pm

[QUOTE=3BEPb]R U sure you changed database path to the actual this line:
c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("./DBFolder/DB.mdb")[/QUOTE]

I think if this was the error it would give him a path problem... like database can't be found.

What OS do you have? and is the Access Driver Installed?

Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2003 at 12:56pm

Hi,

I did change the patyh of the DB.
I can create asp pages with info showing from access tables in and input info into my tables from the web page, this is no problem, but all i want is a simple ARTIST, TITLE, LABEL search field for users to search with. I am running Windows XP.

 

thanks

mark

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.