Hi, friends!
Question:
I am attempting to use multiple search tables using only 1 (one) .asp fileand 1(one)only .html file.
I would like to see a script following the 'head' below.
I don't know how to do the .html file for searching multiple tables. Also I unknows as to do an .asp file
for searching multiple tables.
If someone could either please tell me the correct way to do this, or where I could try find this out on my own.
Many Thanks
KK
<!-- Input.htm -->
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form action="searchdb.asp" method="post" name="DaForm" align="center">
<BR>
<CENTER><img src="/images/linotipista.g
if" width="100" height="100" border="0">
<CENTER><BR><FONT color="#000000"
face="Verdana" size=3>
<CENTER>Search database</FONT></CENTER><B
R>
<DIV align=center>
<select name="TypeSearch" size="1">
<option selected value="EnglishCastilian">E
nglish-Cas
tilian</op
tion>
<option value="EnglishFrench">Engl
ish-French
</option>
<option value="EnglishItalian">Eng
lish-Itali
an</option
>
<option value="EnglishPortuguese">
English-Po
rtuguese</
option>
<input type="text" size="15" name="look_for"><br>
<input type="submit" name="B1" value="Search">
<BR></DIV></CENTER></CENTE
R></FORM><
BR>
</TD></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE>
<BR>
</body>
</html>
<!-- SearchDb.asp-->
<%@ LANGUAGE=VBScript %>
<%
set conn=server.CreateObject("
adodb.conn
ection")
conn.open "Provider=Microsoft.jet.ol
edb.4.0;da
ta source="& server.MapPath("bd1.mdb")
Dim strKeyword
strKeyword = Request.QueryString("look_
for")
Dim rs
Set rs = CreateObject("ADODB.Record
set")
rs.CursorLocation = adUseClient
rs.PageSize = recordsToShow
rs.CacheSize = recordsToShow
Select Case UBound(strKeyword)
Case 0 rs.Open "select * from ec where keywords like '"&strKeyword&"' ", con, adOpenForwardOnly, adLockReadOnly, adCmdText
Case 1 rs.Open "select * from ef where english like '%" & strKeyword & "%' or french like '%" & strKeyword & "%'", order by english desc con
Case 2 rs.Open "select * from ei where english like '%" & strKeyword & "%' and italian like '%" & strKeyword & "%' order by english desc", con
Case Else rs.Open "select * from ep where english like '%" & strKeyword & "%' and portuguese like '%" & strKeyword & "%' ", order by english desc con
End Select
%>
And so on...