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.
jlcannonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
When you go to userinput.asp, you need to display just one record.  Assuming your db has a unique id called id, then on that page you will use the sql statement similar to below.

theID = request.querystring("id")
sql = "SELECT * FROM tblData where id= "&theID

Open in new window

The id will come from the querystring userinput.asp?id=123

This should just be used for internal/testing.  You will want to use parameterized queries for your insert statement to prevent sql injections.  From there you will have any fields you want to be edited or inserted.

To generate the link
<%
do while not rs.eof

%>
<a href="userinput.asp?id=<% response.write rs("id")%>">Link to update</a>
<%
	rs.movenext
loop
rs.close
set rs = nothing
%>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jlcannonAuthor Commented:
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.
0
jlcannonAuthor Commented:
Thank you, your comment would absolutely work but I asked my question before fully knowing what I needed to ask.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.