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!

Please help a novice

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi

I have never done a single ASP page, so I am desperate for help here.

What I need to do is to look up the charges for the specific employee.

There is a SQL transit table that contains transit numbers that rollup to specific rollup number.

So, First, I'll have a simple form where the user would enter the rollup number. Then my next page will be the table of the transits belonging to that rollup.

By clicking on each transit number, the user would able to open the next page that contains all employees belonging to that transit.

The charges for the rollups, transits, and then employees will be taken from another SQL table.


Please advise where should I start from

Any sample code would be valueble!!!

Thanks a lot


 
I would suggest reading as to what ASP does before taking on a task without experience. But before I can help you, I must ask, do you know what

DNS is
Recordset is
QueryString is
Loop is

this way I know where to start helping.



[tt]
"The only ideas that will work for you are the ones you put to work."
[/tt]

 
that would be Data Source Name (DSN) and not DNS as my typo indicates.
[tt]
"The only ideas that will work for you are the ones you put to work."
[/tt]

 
I have a little VBA background, so I know what recordset is, DSN is something about the connection to the db, QueryString - well I'll read on this one
And i do know loops.
 
[tt]

Ok, here's a water-down version of what you need to do, this is to simply show you the logic in code...

I've called this page Search.asp

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;Connections/adfluence.asp&quot; -->
<%
set rsSearch = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsSearch.ActiveConnection = MM_adfluence_STRING
rsSearch.Source = &quot;SELECT * FROM department&quot;
rsSearch.CursorType = 0
rsSearch.CursorLocation = 2
rsSearch.LockType = 3
rsSearch.Open()
rsSearch_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;search2.asp?id=<%=rsSearch(&quot;id&quot;)%>&quot;>
Search Rollup Number:
<input type=&quot;text&quot; name=&quot;search&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
</form>
</body>
</html>
<%
rsSearch.Close()
%>


And I've called this page Search2.asp

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;Connections/adfluence.asp&quot; -->
<%
Dim rsResults__MMColParam
rsResults__MMColParam = &quot;1&quot;
if (Request.QueryString(&quot;ID&quot;) <> &quot;&quot;) then rsResults__MMColParam = Request.QueryString(&quot;ID&quot;)
%>
<%
set rsResults = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsResults.ActiveConnection = MM_adfluence_STRING
rsResults.Source = &quot;SELECT * FROM department WHERE ID = &quot; + Replace(rsResults__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;&quot;
rsResults.CursorType = 0
rsResults.CursorLocation = 2
rsResults.LockType = 3
rsResults.Open()
rsResults_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot;>
<tr>
<td>ID</td>
<td>Dept ID</td>
<td>Dept</td>
<td>Supervisor</td>
</tr>
<tr>
<td><%=(rsResults.Fields.Item(&quot;ID&quot;).Value)%></td>
<td><%=(rsResults.Fields.Item(&quot;deptid&quot;).Value)%></td>
<td><%=(rsResults.Fields.Item(&quot;dept&quot;).Value)%></td>
<td><%=(rsResults.Fields.Item(&quot;supervisor&quot;).Value)%></td>
</tr>
</table>
</body>
</html>
<%
rsResults.Close()
%>


Basically what I'm doing is a search by Rollup Number and carrying that number from in the URL then on Search2.asp I'm requesting everything from my database where the rollup number = the database.

Now what you can do is simply either redirect them when the number is not found of display on the screen &quot;number not found&quot; please try agin link.

let me know if this helps gets you going.


P.S.
As you can see, I'm using DreamWeaver 4 to write my code but you can use anything you feel confortable with to accomplish this. thanks
[tt]
&quot;The only ideas that will work for you are the ones you put to work.&quot;
[/tt]

 
Thanks a lot TonyU,

I always admire people like you who help out the strangers with in such a professional manner. Thanks again!

For me as a novice, it will take a while to analyze the code you gave me and then I may come back and ask for more clues.

I appreaciate your help!
 
[tt]Anytime, and please let us know if you need more assistance, anyone here will be more than happy to assist you....
[tt]
&quot;The only ideas that will work for you are the ones you put to work.&quot;
[/tt]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top