Print Page | Close Window

database search

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=4827
Printed Date: 28 March 2026 at 9:02am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: database search
Posted By: ainsworth14
Subject: database search
Date 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




Replies:
Posted By: zMaestro
Date 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.



Posted By: ainsworth14
Date 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?



Posted By: 3BEPb
Date 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")

 



Posted By: zMaestro
Date 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?



Posted By: ainsworth14
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net