*****************************************************
AND OF COURSE YOU CAN'T READ IT SO HERE IT IS AGAIN
*****************************************************
If you are testing this project on a server you will need to know what a
"DSN" is (if you already know, cool).
Here we go
1. Create an
HTML page and name it
Search.htm and paste this code in it
<form method="POST" action="Search.asp">
<p><font color="#000080"><input type="text" name="firstsearch" size="10"></font>
<font color="#000080"><input type="submit" value="Go" name="submit">
<input type="reset" value="Clear" name="reset"> </font></p>
</form>
What this will do is as the name explains it, create a Search page with a field for the user to fill.
********************************************************************
2. Create another page and name it
Search.asp
and page this in it.
<%
reqtypesearch = Request("
firstsearch"
'this is the name of your field in the Search.htm form
sql = "Select * from Customer"
sql = sql & " where fname like '" & reqtypesearch & "%' order by last" 'this will do a search on the Customers table on any name user types in and it will sort it by last name
'
This will set a connection to the your database customers.
'Connection1 to customers Table
Dim RScustomer
set RScustomer=server.createobject("ADODB.recordset"
RScustomer.open sql, "DSN=YOUR_DSN_NAME_HERE"
if RScustomer.EOF then
response.redirect "norecordsfound.asp" 'This is used to let the user know that the name searched was not fould. - You can use this or JavaScript which is better.
end if
'This will set a connection to the your database Books.
'Connection1 to Books Table
Dim RSbooks
set RSbooks=server.createobject("ADODB.recordset"
RSbooks.open sql, "DSN=YOUR_DSN_NAME_HERE"
if RSbooks.EOF then
response.redirect "norecordsfound.asp"
end if
'This will set a connection to the your database CUST_SHIPMENT.
'Connection1 to Books Table
Dim RSCSHIPMENT
set RSCSHIPMENT=server.createobject("ADODB.recordset"
RSCSHIPMENT.open sql, "DSN=YOUR_DSN_NAME_HERE"
if RSCSHIPMENT.EOF then
response.redirect "norecordsfound.asp"
end if
%>
Now, where you want to display the data pulled, create a table if you want with the fields needed.
Like this:
This is the table header
<center><table border="0" width="98%">
<tr>
<td width="9%" align="left" bgcolor="#7575BB">
<p dynamicanimation="fpAnimelasticRightFP1" id="fpAnimelasticRightFP1" style="position: relative !important; visibility: hidden" language="Javascript1.2"><u><font color="#FFFFFF" size="2">First</font></u></p>
</td>
<td width="9%" align="left" bgcolor="#7575BB"><u><font color="#FFFFFF" size="2">First Name</font></u></td>
<td width="16%" align="left" bgcolor="#7575BB"><u><font color="#FFFFFF" size="2">Last Name</font></u></td>
<td width="14%" align="left" bgcolor="#7575BB"><u><font color="#FFFFFF" size="2">Book Title</font></u></td>
<td width="17%" align="left" bgcolor="#7575BB"><u><font color="#FFFFFF" size="2">Trans Number</font></u></td>
<td width="14%" align="left" bgcolor="#7575BB"><u><font color="#FFFFFF" size="2">Cust Ship Date</font></u></td>
</tr>
This is the data you requested from the SQL Statement
<tr>
<td width="9%" align="left" bgcolor="#DBE8E1"><font color="#000080" size="2"><%=RScustomer("fname"
%></font></td>
<td width="9%" align="left" bgcolor="#DBE8E1"><font color="#000080" size="2"><%=RScustomer("lname"
%></font></td>
<td width="16%" align="left" bgcolor="#DBE8E1"><font color="#000080" size="2"><%=RSbooks("title"
%></font></td>
<td width="14%" align="left" bgcolor="#DBE8E1">
<td width="17%" align="left" bgcolor="#DBE8E1"><font color="#000080" size="2"><%=RSCSHIPMENT("TRANS_NUMBER"
%></font></td>
<td width="14%" align="left" bgcolor="#DBE8E1"><font color="#000080" size="2"><%=RSCSHIPMENT("CUST_SHIP_DATE"
%></font></td>
</tr>
I hope this helps bro. QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>