Link to home
Start Free TrialLog in
Avatar of jlcannon
jlcannon

asked on

posting data retruned from one ASP page to another to add additional information via a user input then store all in an access database table.

I have an ASP page that pulls data in from several different excel forms and displays them by campus. for each different campus I make a new record set. once they are all displayed what I want to do is allow a user to click a link in their section that will then open another ASP page and carry over only the particular record they clicked the link on and be able to add a comment as to why the record is out of compliance. Below is the code I am currently using to display the data:

<html>
<%


		vXlsFile = "/virtual/data/AU.xlsm"

		vXlsFile = Server.Mappath(vXlsFile)
		
		vXlsFile1 = "/virtual/documents/TechReport/ScholasticRecord.xlsm"
		vXlsFile1 = Server.Mappath(vXlsFile1)

		vXlsFile2 = "/virtual/documents/TechReport/PersonalInfo.xlsx"
		vXlsFile2 = Server.Mappath(vXlsFile2)
		
		
		
		
		ExcelConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set Conn = Server.CreateObject("ADODB.Connection")
		Conn.Open ExcelConnString
		
		
		XlsConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile1 & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set xConn = Server.CreateObject("ADODB.Connection")
		xConn.Open XlsConnString

	XlsxConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile2 & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set xlConn = Server.CreateObject("ADODB.Connection")
		xlConn.Open XlsxConnString

%>

Open in new window


then down where is display the data:

<%
        	
		sql = "SELECT * FROM tblData where Site Like trim('DTotal') ;" 

			
			set RS = server.createobject("adodb.recordset")
			RS.open sql,Conn,adOpenForwardOnly,adLockReadOnly

<%
If FormatNumber(rs.Fields("%AC_HrBasis ").Value * 100) < 85 Then
	Response.Write "<th style='width: 266px; height: 21px; border-color:black; color: Red; background-color:silver' class='auto-style3'><strong>Red - "
Elseif FormatNumber(rs.Fields("%AC_HrBasis ").Value * 100) < 90 AND FormatNumber(rs.Fields("%AC_HrBasis ").Value * 100) > 85 Then
	Response.Write "<th style='width: 266px; height: 21px; border-color:black; color: Yellow; background-color:silver' class='auto-style3'><strong>Yellow - "
Elseif FormatNumber(rs.Fields("%AC_HrBasis ").Value * 100) > 90 Then
	Response.Write "<th style='width: 266px; height: 21px; border-color:black; color: green; background-color:silver' class='auto-style3'><strong>Green - "
End If
%><%=FormatNumber(rs.Fields("%AC_HrBasis ").Value * 100)%>%


</strong></th>
<%
If FormatNumber(rs.Fields("%PSR_HrBasis ").Value * 100) < 92 Then
	Response.Write "<th style='width: 266px; height: 21px; border-color:black; color: Red; background-color:silver' class='auto-style3'><strong>Red - "
Elseif FormatNumber(rs.Fields("%PSR_HrBasis ").Value * 100) < 96 AND FormatNumber(rs.Fields("%PSR_HrBasis ").Value * 100) > 92 Then
	Response.Write "<th style='width: 266px; height: 21px; border-color:black; color: Yellow; background-color:silver' class='auto-style3'><strong>Yellow - "
Elseif FormatNumber(rs.Fields("%PSR_HrBasis ").Value * 100) > 96 Then
	Response.Write "<th style='width: 266px; height: 21px; border-color:black; color: green; background-color:silver' class='auto-style3'><strong>Green - "
End If
%><%=FormatNumber(rs.Fields("%PSR_HrBasis ").Value * 100)%>%
</strong></th>



<%
	rs.movenext
loop
rs.close
set rs = nothing
%>

<%


		sql = "SELECT * FROM tblData where CampusName Like trim('DPEast%') ;" 
			
		
			set RS = server.createobject("adodb.recordset")
			RS.open sql,xConn,adOpenForwardOnly,adLockReadOnly
%>
<%
do while not rs.eof

%>

</strong></th>
<th style="background-color:silver; width: 301px; height: 21px;" class="auto-style3"><strong>
<%
If rs.Fields("SiteOutAvg") = 1 Then
	Response.Write "Green - <img src=../../images/dotgreen.gif>"
Elseif rs.Fields("SiteOutAvg") = 2 Then
	Response.Write "Red - <img src=../../images/dotred.gif>"
Elseif rs.Fields("SiteOutAvg") = 3 Then
	Response.Write "Red - <img src=../../images/dotred.gif>"
End If
%>
</strong></th>


<%
	rs.movenext
loop
rs.close
set rs = nothing
%>
<%'**********This is For Nx*************%>
<%

		sql = "SELECT * FROM tblData where title Like trim('Nx%') ;" 

			
			set RS = server.createobject("adodb.recordset")
			RS.open sql,xlConn,adOpenForwardOnly,adLockReadOnly


%>
<%
do while not rs.eof

%>

						

<th style="background-color:silver; width: 301px; height: 21px;" class="auto-style3"><strong><%'=FormatNumber(rs.Fields("Poc").Value)%>N/A</strong></th>

<%
	rs.movenext
loop
rs.close
set rs = nothing
%>

</tr>

Open in new window


So this is working to display what I want on this page, but what I need to do now is of the records returned I need to choose one particular one and when they click the link to go to userinput.asp it will carry over the information returned for that particular line so they can then add a comment in a text field.
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jlcannon
jlcannon

ASKER

SO sorry, I was away and had no access to outside internet.  I am pulling the data for this main page off of 3 different excel files. I then have created an access database that has a table called tblCompData and what I want is on the page that I have that gathers the data from the 3 different excel workbooks, the data is broken up into rows by the site related so then a user could click on a link on a row they want to add a note to and it would open up another web page with not only the data from that row but also a "description" field so they can add comments then when they click save it adds all that data to the access database to tblCompData.
Thank you, your comment would absolutely work but I asked my question before fully knowing what I needed to ask.