Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP HELP....

Status
Not open for further replies.

bfletch

MIS
May 3, 2000
167
US
I am looking for someone to give me some major help in ASP, maybe in email or IM. I have this page for class that I need to function, and I am clueless. Its an HTML page that writes to an ASP page. On the HTML page, you enter the customer's FNAME, LNAME, TITLE, and TRANS_NUMBER. It does a search then is suspose to print out the date the book has been sent out or not been sent out. The tables in the db are as follows:

FNAME & LNAME are in CUSTOMER
TITLE is in BOOKS
TRANS_NUMBER is in CUST_SHIPMENT
CUST_SHIP_DATE is in CUST_SHIPMENT

I have the HTML page working just fine, but the ASP is killing me, PPPLLLEEAAAASSSEEEEE help. Let me know and I can give you either my AOL messenger or MSN messenger. Thanks, I really appreciate it.
 
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=&quot;POST&quot; action=&quot;Search.asp&quot;>
<p><font color=&quot;#000080&quot;><input type=&quot;text&quot; name=&quot;firstsearch&quot; size=&quot;10&quot;></font>
<font color=&quot;#000080&quot;><input type=&quot;submit&quot; value=&quot;Go&quot; name=&quot;submit&quot;>
<input type=&quot;reset&quot; value=&quot;Clear&quot; name=&quot;reset&quot;> </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(&quot;firstsearch&quot;) 'this is the name of your field in the Search.htm form
sql = &quot;Select * from Customer&quot;
sql = sql & &quot; where fname like '&quot; & reqtypesearch & &quot;%' order by last&quot; '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(&quot;ADODB.recordset&quot;)
RScustomer.open sql, &quot;DSN=YOUR_DSN_NAME_HERE&quot;
if RScustomer.EOF then
response.redirect &quot;norecordsfound.asp&quot; '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(&quot;ADODB.recordset&quot;)
RSbooks.open sql, &quot;DSN=YOUR_DSN_NAME_HERE&quot;
if RSbooks.EOF then
response.redirect &quot;norecordsfound.asp&quot;
end if


'This will set a connection to the your database CUST_SHIPMENT.
'Connection1 to Books Table
Dim RSCSHIPMENT
set RSCSHIPMENT=server.createobject(&quot;ADODB.recordset&quot;)
RSCSHIPMENT.open sql, &quot;DSN=YOUR_DSN_NAME_HERE&quot;
if RSCSHIPMENT.EOF then
response.redirect &quot;norecordsfound.asp&quot;
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=&quot;0&quot; width=&quot;98%&quot;>
<tr>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;>
<p dynamicanimation=&quot;fpAnimelasticRightFP1&quot; id=&quot;fpAnimelasticRightFP1&quot; style=&quot;position: relative !important; visibility: hidden&quot; language=&quot;Javascript1.2&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>First</font></u></p>
</td>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>First Name</font></u></td>
<td width=&quot;16%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Last Name</font></u></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Book Title</font></u></td>
<td width=&quot;17%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Trans Number</font></u></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Cust Ship Date</font></u></td>
</tr>


This is the data you requested from the SQL Statement
<tr>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RScustomer(&quot;fname&quot;)%></font></td>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RScustomer(&quot;lname&quot;)%></font></td>
<td width=&quot;16%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RSbooks(&quot;title&quot;)%></font></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;>
<td width=&quot;17%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RSCSHIPMENT(&quot;TRANS_NUMBER&quot;)%></font></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RSCSHIPMENT(&quot;CUST_SHIP_DATE&quot;)%></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
%>
 
*****************************************************
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 &quot;DSN&quot; 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=&quot;POST&quot; action=&quot;Search.asp&quot;>
<p><font color=&quot;#000080&quot;><input type=&quot;text&quot; name=&quot;firstsearch&quot; size=&quot;10&quot;></font>
<font color=&quot;#000080&quot;><input type=&quot;submit&quot; value=&quot;Go&quot; name=&quot;submit&quot;>
<input type=&quot;reset&quot; value=&quot;Clear&quot; name=&quot;reset&quot;>&nbsp;</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(&quot;firstsearch&quot;) 'this is the name of your field in the Search.htm form
sql = &quot;Select * from Customer&quot;
sql = sql & &quot; where fname like '&quot; & reqtypesearch & &quot;%' order by last&quot; '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(&quot;ADODB.recordset&quot;)
RScustomer.open sql, &quot;DSN=YOUR_DSN_NAME_HERE&quot;
if RScustomer.EOF then
response.redirect &quot;norecordsfound.asp&quot; '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(&quot;ADODB.recordset&quot;)
RSbooks.open sql, &quot;DSN=YOUR_DSN_NAME_HERE&quot;
if RSbooks.EOF then
response.redirect &quot;norecordsfound.asp&quot;
end if


'This will set a connection to the your database CUST_SHIPMENT.
'Connection1 to Books Table
Dim RSCSHIPMENT
set RSCSHIPMENT=server.createobject(&quot;ADODB.recordset&quot;)
RSCSHIPMENT.open sql, &quot;DSN=YOUR_DSN_NAME_HERE&quot;
if RSCSHIPMENT.EOF then
response.redirect &quot;norecordsfound.asp&quot;
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=&quot;0&quot; width=&quot;98%&quot;>
<tr>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;>
<p dynamicanimation=&quot;fpAnimelasticRightFP1&quot; id=&quot;fpAnimelasticRightFP1&quot; style=&quot;position: relative !important; visibility: hidden&quot; language=&quot;Javascript1.2&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>First</font></u></p>
</td>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>First Name</font></u></td>
<td width=&quot;16%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Last Name</font></u></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Book Title</font></u></td>
<td width=&quot;17%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Trans Number</font></u></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#7575BB&quot;><u><font color=&quot;#FFFFFF&quot; size=&quot;2&quot;>Cust Ship Date</font></u></td>
</tr>


This is the data you requested from the SQL Statement
<tr>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RScustomer(&quot;fname&quot;)%></font></td>
<td width=&quot;9%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RScustomer(&quot;lname&quot;)%></font></td>
<td width=&quot;16%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RSbooks(&quot;title&quot;)%></font></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;>
<td width=&quot;17%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RSCSHIPMENT(&quot;TRANS_NUMBER&quot;)%></font></td>
<td width=&quot;14%&quot; align=&quot;left&quot; bgcolor=&quot;#DBE8E1&quot;><font color=&quot;#000080&quot; size=&quot;2&quot;><%=RSCSHIPMENT(&quot;CUST_SHIP_DATE&quot;)%></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
%>
 
Thank I will try to do that. I already have dnsEcommerce and also the 2 pages made. The HTML and the ASP. The problem was the asp coding. If you wanted, I could send the the pages I created. Thanks for all of your help.
 
that's fine, send them to jr_clown@yahoo.com
I'll be more than happy to assist you in any way. I may not be able to get back to you untill this afternoon tho bet 2:30 - 3:00 pm est. Hope it's ok.

If you need this right away, you can use the code above. QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
What a great country we live in when others will do our homework for us!!!!

(Where was JrClown when I was in school?)
 
LOL MikeT. Hey bro, we all need a push one way or another. And what better way to make someone understand a problem than to show him\her how's done and let them pick it apart. I promise you that we won't see this post again from the same person. QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top