How do I search the MS Access Database

Results 1 to 2 of 2

Thread: How do I search the MS Access Database

  1. #1
    Ken L. Guest

    Default How do I search the MS Access Database

    I have gone through acouple books on asp but none gave me a specific example of doing a search on the MS access database. Can anyone please show me a sample search query on MS Access.<BR>I have a database with a table called UniqueApps. The UniqueApps talble has 4 fields: Manufacturer(text), Products(text), Size(number) and Status(text).<BR>I want to do a query that if a customer can search UNDER Manufacturer, Products or Size. <BR>For example: if a customer selects to search under Manufacturer and types in the word Adobe, the query would get all the records contains the word Adobe in it and displays in another table.<BR><BR>any help, suggestiong would be greatly appreciated.<BR>ken (

  2. #2
    olivia Guest

    Default RE: How do I search the MS Access Database

    It isn&#039t really different from ASP query. For Access databases the connection is a little different:<BR><BR>set conn=server.createobject("adodb.connection")<BR>cn path="DBQ=" & server.mappath("database.mdb")<BR>conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath<BR><BR>This is a DSNless connection. Or you could use a file or system dsn.<BR><BR>Bring in the users input from the form. For example:<BR>strManufacturer = request.form("manufacturer")<BR><BR>Your query string might be:<BR>qryselect ="select * from UniqueApps where manufacturer=&#039" & strManufacturer & "&#039"<BR>set rstemp=conn.execute(qryselect)<BR><BR>Then display your new table:<BR><BR>&#060;table border=1 cellpadding=4 cellspacing=0"><BR>&#060;%<BR>Do while not rstemp.eof<BR>response.write "&#060;tr>&#060;td>" & rstemp("manufacturer") & "&#060;/td>&#060;td>" & rstemp("products") & "&#060;/td>&#060;td>" & rstemp("size") & "&#060;/td>&#060;td>" & rstemp("status") & "&#060;/td>&#060;/tr>"<BR>rstemp.movenext<BR>loop<BR> &#037;&#062;<BR> &#060;/table><BR><BR>So it isn&#039t really different then any other ASP query. Just the connecetion is a little different.<BR><BR>oc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts