dtolo
asked on
I need to make a page that uses one table in SQL to update another. ASAP
I posted a question in the asp Side that is giving them trouble because I have to use front page. It is worth 500 points. Follow this link:
https://www.experts-exchange.com/questions/21085175/I-need-to-make-a-page-that-uses-one-table-in-SQL-to-update-another.html#11739119
https://www.experts-exchange.com/questions/21085175/I-need-to-make-a-page-that-uses-one-table-in-SQL-to-update-another.html#11739119
ASKER
I want the first form (that is generated from the employee table to update the register table. The tables are in the same SQL dbase.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
RCBM,
Thank you this looks great! I am going to try this right now. At first glance it seems that on page one I should just reverse the order of the drop - Down list and make Employee number first, because I want the Employee to sign up by choosing thier employee number since there are a lot of duplicate last names.
I will get back to to you after I try it out.
~David
Thank you this looks great! I am going to try this right now. At first glance it seems that on page one I should just reverse the order of the drop - Down list and make Employee number first, because I want the Employee to sign up by choosing thier employee number since there are a lot of duplicate last names.
I will get back to to you after I try it out.
~David
David,
You are right if you have an issue with alot of the same names. If you are just using employee numbers then do something like this in the first page
<option><%=FP_FieldHTML(fp _rs,"EmpNu m")%></opt ion>
This will just have the employee number displayed and will not require an option value as it will submit the number to page 2.
R/RCMB
You are right if you have an issue with alot of the same names. If you are just using employee numbers then do something like this in the first page
<option><%=FP_FieldHTML(fp
This will just have the employee number displayed and will not require an option value as it will submit the number to page 2.
R/RCMB
ASKER
RCBM,
I like this solution so far. I am getting an error message on page 2 from my browser:
Technical Information (for support personnel)
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'fp_rs'
/cssd/prototype/TA/page2.a sp, line 48
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Page:
GET /cssd/prototype/TA/page2.a sp?Employe eNumber=52 4503&B1=Su bmit
Time:
Monday, August 09, 2004, 12:57:29 PM
This is the code from my whole page:
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form>
<nobr>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-columntypes="3,202,200,2 00,200,202 ,202,202,2 02,202,200 ,200,200,2 00,200,200 ,200,200,2 00" s-dataconnection="TA-UPDAT E" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="EmployeeNumb er" s-menuvalue="EmployeeNumbe r" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Students" s-displaycolumns="Employee Number" s-criteria="[EmployeeNumbe r] EQ {EmployeeNumber} +" s-order s-sql="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="EmployeeN umber=" s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Da tabase< /span> " startspan --><!--#include file="../_fpclass/fpdblib. inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe r="
fp_sNoRecords="No records returned."
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="EmployeeNu mber"
fp_sMenuValue="EmployeeNum ber"
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="59487" --><select NAME="EmployeeNumber" SIZE="1">
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd brgn1.inc" startspan --><!--#include file="../_fpclass/fpdbrgn1 .inc"--><! --webbot bot="AspInclude" endspan i-checksum="52766" -->
<option><%=FP_FieldHTML(fp _rs,"Emplo yeeNumber" )%></optio n>
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd brgn2.inc" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"--><! --webbot bot="AspInclude" endspan i-checksum="52830" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Re sults</ span> " startspan --><!--webbot bot="DatabaseRegionEnd" endspan --></nobr></form>
<% response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
</body>
Line 48 where the error is generated is:
varLname = fp_rs("LastName")
I like this solution so far. I am getting an error message on page 2 from my browser:
Technical Information (for support personnel)
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'fp_rs'
/cssd/prototype/TA/page2.a
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Page:
GET /cssd/prototype/TA/page2.a
Time:
Monday, August 09, 2004, 12:57:29 PM
This is the code from my whole page:
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form>
<nobr>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe
fp_sNoRecords="No records returned."
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="EmployeeNu
fp_sMenuValue="EmployeeNum
fp_sColTypes="&StudentID=3
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="59487" --><select NAME="EmployeeNumber" SIZE="1">
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd
<option><%=FP_FieldHTML(fp
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../_fpclass/fpdb
<% response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
</body>
Line 48 where the error is generated is:
varLname = fp_rs("LastName")
ASKER
Disregard that last part. I solved the error (it was an error I made). It seems to work fine .. but the register table is not getting updated. I will recheck the code on page3.asp
ASKER
This is the code from page 3. I tested the query and it seems fine, but the records are not getting updated.
<body>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="TA-UPDAT E" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="LastName= &amp;F irstName=& amp;amp;Em ployeeNumb er=&am p;Email=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the start of a Database Results region.</font></t d></ tr>" startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="TRUE" --><!--#include file="../_fpclass/fpdblib. inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')"
fp_sDefault="LastName=&Fir stName=&Em ployeeNumb er=&Email= "
fp_sNoRecords="<tr><td colspan=16 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1 .inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="52006" --><!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% response.redirect "registered.htm" %>
</body>
Any Idea what I am doing wrong?
<body>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="TA-UPDAT
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')"
fp_sDefault="LastName=&Fir
fp_sNoRecords="<tr><td colspan=16 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="52006" --><!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% response.redirect "registered.htm" %>
</body>
Any Idea what I am doing wrong?
A question for you on the page 3 issue
I assumed you are creating a record in the register table but you indicate the "table is not getting updated". Are you attempting to update an existing record in the register table or are you trying to create a new record?
The difference here is in the SQL statement in that page 3 would change from INSERT INTO... to UPDATE...
Let me know.
RCMB
I assumed you are creating a record in the register table but you indicate the "table is not getting updated". Are you attempting to update an existing record in the register table or are you trying to create a new record?
The difference here is in the SQL statement in that page 3 would change from INSERT INTO... to UPDATE...
Let me know.
RCMB
In page two what does the last line look like (before the </body> and </html> tags)?
Lets make sure we are getting the data from page two.
Comment out the reponse.redirect by placing a ' before response and then enter this:
<%=varLname%><br>
<%=varFname%><br>
<%=varEmpNum%><br>
<%=varEmail%>
If all is working correctly you should see the employees last and first name, employee number and email address after you select their employee number from the first page.
RCMB
Lets make sure we are getting the data from page two.
Comment out the reponse.redirect by placing a ' before response and then enter this:
<%=varLname%><br>
<%=varFname%><br>
<%=varEmpNum%><br>
<%=varEmail%>
If all is working correctly you should see the employees last and first name, employee number and email address after you select their employee number from the first page.
RCMB
ASKER
OK,
You are right.
I am adding not updating.
Page 2 before modifications:
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-columntypes="3,202,200,2 00,200,202 ,202,202,2 02,202,200 ,200,200,2 00,200,200 ,200,200,2 00" s-dataconnection="TA-UPDAT E" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Students" s-displaycolumns="Employee Number" s-criteria="[EmployeeNumbe r] EQ {EmployeeNumber} +" s-order s-sql="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="EmployeeN umber=" s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the start of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdblib. inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe r="
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1 .inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="50921" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-column="EmployeeNumber" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&am p;lt;& lt;</fo nt>Empl oyeeNumber <font size="-1">&am p;gt;& gt;</fo nt>" startspan --><%=FP_FieldVal(fp_rs,"E mployeeNum ber")%><!- -webbot bot="DatabaseResultColumn" endspan i-checksum="41846" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
</body>
After:
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe r="
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1 .inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="50921" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-column="EmployeeNumber" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&am p;lt;& lt;</fo nt>Empl oyeeNumber <font size="-1">&am p;gt;& gt;</fo nt>" startspan --><%=FP_FieldVal(fp_rs,"E mployeeNum ber")%><!- -webbot bot="DatabaseResultColumn" endspan i-checksum="41846" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% 'response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
<%=varLname%><br>
<%=varFname%><br>
<%=varEmpNum%><br>
<%=varEmail%>
</body>
You are right.
I am adding not updating.
Page 2 before modifications:
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="50921" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn"
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
</body>
After:
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="50921" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn"
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% 'response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
<%=varLname%><br>
<%=varFname%><br>
<%=varEmpNum%><br>
<%=varEmail%>
</body>
ASKER
It is showing the info after I added your code. I can't see why the records don't get added.
ASKER
RCBM,
On page 3 does there have to be code change for the variable names?
INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')
The variables are varLname etc. I don't see how these are carried over.
On page 3 does there have to be code change for the variable names?
INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')
The variables are varLname etc. I don't see how these are carried over.
Okay all looks good so far so lets see if the problem is in page 3.
Comment out the redirect in page 3 like we did in page 2 and try submitting the information again.
What we should see on page 3 is the url passed from page 2 with all of the information like so:
http://www.xxxxxx.com/page3.asp?LastName=Smith&FirstName=Randall&EmployeeNumber=12112&Email=smithr@something.com
This will tell us that the data is in fact getting passed and let us know if we have any other errors being returned from the server.
On page two you have some additional code that is not required
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-column="EmployeeNumber" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&am p;lt;& lt;</fo nt>Empl oyeeNumber <font size="-1">&am p;gt;& gt;</fo nt>" startspan --><%=FP_FieldVal(fp_rs,"E mployeeNum ber")%><!- -webbot bot="DatabaseResultColumn" endspan i-checksum="41846" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
Should read:
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></
</tbody>
</table>
Delete starting with <tr> and ending with </tr> -- Just cleans it up and makes it easier to follow :-)
RCMB
Comment out the redirect in page 3 like we did in page 2 and try submitting the information again.
What we should see on page 3 is the url passed from page 2 with all of the information like so:
http://www.xxxxxx.com/page3.asp?LastName=Smith&FirstName=Randall&EmployeeNumber=12112&Email=smithr@something.com
This will tell us that the data is in fact getting passed and let us know if we have any other errors being returned from the server.
On page two you have some additional code that is not required
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn"
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
Should read:
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></
</tbody>
</table>
Delete starting with <tr> and ending with </tr> -- Just cleans it up and makes it easier to follow :-)
RCMB
These are carried over by the URL string
INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')
The variables are varLname etc. I don't see how these are carried over.
Your URL string states
LastName=" & varLname & "&....
What your query then looks for is what is in LastName so you insert would add to the database in the field LastName whatever was contained in the URL string for LastName.
RCMB
INSERT INTO Register (LastName, FirstName, EmployeeNumber, Email) VALUES ('::LastName::', '::FirstName::', '::EmployeeNumber::', '::Email::')
The variables are varLname etc. I don't see how these are carried over.
Your URL string states
LastName=" & varLname & "&....
What your query then looks for is what is in LastName so you insert would add to the database in the field LastName whatever was contained in the URL string for LastName.
RCMB
ASKER
The Url looks good. Here is a sample:
http://zeusdev/cssd/prototype/ta/page3.asp?LastName=Crain&FirstName=Walter&EmployeeNumber=468646&Email=
(That record did not have an e-mail attached)
The page reads:
Database Results Wizard Error
The operation failed. If this continues, please contact your server administrator.
http://zeusdev/cssd/prototype/ta/page3.asp?LastName=Crain&FirstName=Walter&EmployeeNumber=468646&Email=
(That record did not have an e-mail attached)
The page reads:
Database Results Wizard Error
The operation failed. If this continues, please contact your server administrator.
ASKER
I tried using the wizard that allows to add a page that edits your SQL table, that seems to update fine, so I don't think it is a permissions issue.
Could it be that some of the fields may have nulls? Eventually they won't It is due to be cleaned up soon.
Could it be that some of the fields may have nulls? Eventually they won't It is due to be cleaned up soon.
Okay this tells me you are using FP2003 running on IIS5.0 or older.
What we need to do is to repalce a few files on your webserver. With FrontPage open click on Tools, Web Settings, Parameters and check the box to display hidden files and folders. Say yes to refresh the site.
You will then see a directory name _fpclass, open this directory and export all the files in there to some place to protect them as we are going to replace them.
Here are two files you will need to copy them to notepad and then save them with the file names at the beginning of the code. Then copy them into the _fpclass directory and replace the existing files.
All should work then.
RCMB
fpdblib.inc
<%
Sub FP_SetLocaleForPage
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Err.Clear
if FP_CodePage <> 0 then
Session.CodePage = FP_CodePage
if Err.Number <> 0 then Session.CodePage = Session("FP_OldCodePage")
end if
Err.Clear
if FP_LCID <> 0 then
Session.LCID = FP_LCID
if Err.Number <> 0 then Session.LCID = Session("FP_OldLCID")
end if
End Sub
Sub FP_RestoreLocaleForPage
On Error Resume Next
if Session("FP_OldCodePage") <> 0 then
Session.CodePage = Session("FP_OldCodePage")
end if
if Session("FP_OldLCID") <> 0 then
Session.LCID = Session("FP_OldLCID")
end if
Err.Clear
End Sub
Function FP_HTMLEncode(str)
FP_HTMLEncode = str
FP_HTMLEncode = Replace(FP_HTMLEncode,"&", "^^@^^")
FP_HTMLEncode = Server.HTMLEncode(FP_HTMLE ncode)
FP_HTMLEncode = Replace(FP_HTMLEncode,"^^@ ^^","&")
End Function
Function FP_FieldVal(rs, fldname)
FP_FieldVal = FP_HTMLEncode(FP_Field(rs, fldname))
if FP_FieldVal = "" then FP_FieldVal = " "
End Function
Function FP_Field(rs, fldname)
If Not IsEmpty(rs) And Not (rs Is Nothing) and Not IsNull(rs(fldname)) Then
Select Case rs(fldname).Type
Case 128, 204, 205 ' adBinary, adVarBinary, adLongVarBinary
FP_Field = "[#BINARY#]"
Case 201, 203 ' adLongVarChar, adLongVarWChar
if rs(fldname).DefinedSize > 255 then
' check for Access hyperlink fields (only absolute http links)
fp_strVal = rs(fldname)
fp_idxHash1 = InStr(LCase(fp_strVal),"#http://" )
if fp_idxHash1 > 0 then
fp_idxHash2 = InStr(fp_idxHash1+1,fp_str Val,"#")
if fp_idxHash2 > 0 then
' this is an Access hyperlink; extract the URL part
fp_strVal = Mid(fp_strVal,fp_idxHash1+ 1)
if Right(fp_strVal,1) = "#" then
fp_strVal = Left(fp_strVal,Len(fp_strV al)-1)
end if
end if
end if
FP_Field = fp_strVal
else
FP_Field = rs(fldname)
end if
Case Else
FP_Field = rs(fldname)
End Select
Else
FP_Field = ""
End If
End Function
Function FP_FieldHTML(rs, fldname)
FP_FieldHTML = FP_HTMLEncode(FP_Field(rs, fldname))
End Function
Function FP_FieldURL(rs, fldname)
FP_FieldURL = Server.URLEncode(FP_Field( rs, fldname))
End Function
Function FP_FieldLink(rs, fldname)
FP_FieldLink = Replace(FP_Field(rs, fldname), " ", "%20")
End Function
Sub FP_OpenConnection(oConn, sAttrs, sUID, sPWD, fMSAccessReadOnly)
Dim sTmp
Dim sConnStr
Dim fIsAccessDriver
fIsAccessDriver = (InStr(LCase(sAttrs), "microsoft access driver") > 0)
sConnStr = FP_RemoveDriverWithDSN(sAt trs)
sTmp = sConnStr
On Error Resume Next
If fMSAccessReadOnly And fIsAccessDriver Then
sTmp = sTmp & ";Exclusive=1;ReadOnly=1"
Err.Clear
oConn.Open sTmp, sUID, sPWD
If Err.Description = "" Then Exit Sub
End If
Err.Clear
oConn.Open sConnStr, sUID, sPWD
End Sub
Function FP_RemoveDriverWithDSN(sAt trs)
FP_RemoveDriverWithDSN = sAttrs
sDrv = "driver="
sDSN = "dsn="
sLC = LCase(sAttrs)
if InStr(sLC, sDSN) < 1 then exit function
idxFirst = InStr(sLC, sDrv)
if idxFirst < 1 then exit function
idxBeg = idxFirst + Len(sDrv)
if Mid(sLC,idxBeg,1) = "{" then
idxEnd = InStr(idxBeg, sLC, "}")
if idxEnd > 0 and Mid(sLC,idxEnd+1,1) = ";" then
idxEnd = idxEnd + 1
end if
else
idxEnd = InStr(idxBeg, sLC, ";")
end if
if idxEnd < 1 then idxEnd = Len(sLC)
FP_RemoveDriverWithDSN = Left(sAttrs,idxFirst-1) & Mid(sAttrs,idxEnd+1)
End Function
Sub FP_OpenRecordset(rs)
On Error Resume Next
rs.Open
End Sub
Function FP_ReplaceQuoteChars(sQry)
Dim sIn
Dim sOut
Dim idx
sIn = sQry
sOut = ""
idx = InStr(sIn, "%%")
Do While (idx > 0)
sOut = sOut & Left(sIn, idx - 1)
sIn = Mid(sIn, idx + 2)
if (Left(sIn,1) = "%") And (Left(sIn,2) <> "%%") then
sIn = Mid(sIn, 2)
sOut = sOut & "%"
end if
sOut = sOut & "::"
idx = InStr(sIn, "%%")
if idx > 0 then
sOut = sOut & Left(sIn, idx - 1)
sIn = Mid(sIn, idx + 2)
sOut = sOut & "::"
if (Left(sIn,1) = "%") And (Left(sIn,2) <> "%%") then
sIn = Mid(sIn, 2)
sOut = sOut & "%"
end if
end if
idx = InStr(sIn, "%%")
Loop
sOut = sOut & sIn
FP_ReplaceQuoteChars = sOut
End Function
Sub FP_Close(obj)
On Error Resume Next
obj.Close
End Sub
Sub FP_SetCursorProperties(rs)
On Error Resume Next
rs.CursorLocation = 3 ' adUseClient
rs.CursorType = 3 ' adOpenStatic
End Sub
%>
fpdbrgn1.inc
<%
FP_SetLocaleForPage
' determine whether or not to provide navigation controls
if fp_iPageSize > 0 then
fp_fShowNavbar = True
else
fp_fShowNavbar = False
end if
fp_sPagePath = Request.ServerVariables("P ATH_INFO")
fp_sEnvKey = fp_sPagePath & "#fpdbr_" & fp_iRegion
fp_sFormName = "fpdbr_" & CStr(fp_iRegion)
fp_sFormKey = fp_sFormName & "_PagingMove"
fp_sInputs = fp_sDefault
fp_sFirstLabel = " |< "
fp_sPrevLabel = " < "
fp_sNextLabel = " > "
fp_sLastLabel = " >| "
fp_sDashLabel = " -- "
if not IsEmpty(Request(fp_sFormKe y)) then
fp_sMoveType = Request(fp_sFormKey)
else
fp_sMoveType = ""
end if
fp_iCurrent=1
fp_fError=False
fp_bBlankField=False
Set fp_dictInputs = Server.CreateObject("Scrip ting.Dicti onary")
fp_sQry = FP_ReplaceQuoteChars(fp_sQ ry)
' replace any input parameters in query string
Do While (Not fp_fError) And (InStr(fp_iCurrent, fp_sQry, "::") <> 0)
' found a opening quote, find the close quote
fp_iStart = InStr(fp_iCurrent, fp_sQry, "::")
fp_iEnd = InStr(fp_iStart + 2, fp_sQry, "::")
If fp_iEnd = 0 Then
fp_fError = True
Response.Write "<B>Database Results Error: mismatched parameter delimiters</B>"
Else
fp_sField = Mid(fp_sQry, fp_iStart + 2, fp_iEnd - fp_iStart - 2)
fp_sValue = Request.Form(fp_sField)
if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sFi eld)
' if the named form field doesn't exist, make a note of it
If (len(fp_sValue) = 0) Then
fp_iStartField = InStr(fp_sDefault, fp_sField & "=")
if fp_iStartField > 0 then
fp_iStartField = fp_iStartField + len(fp_sField) + 1
fp_iEndField = InStr(fp_iStartField,fp_sD efault,"&" )
if fp_iEndField > 0 then
fp_sValue = Mid(fp_sDefault,fp_iStartF ield,fp_iE ndField - fp_iStartField)
else
fp_sValue = Mid(fp_sDefault,fp_iStartF ield)
end if
end if
End If
' remember names and values used in query
if not fp_dictInputs.Exists(fp_sF ield) then
fp_dictInputs.Add fp_sField, fp_sValue
end if
' this next finds the named form field value, and substitutes in
' doubled single-quotes for all single quotes in the literal value
' so that SQL doesn't get confused by seeing unpaired single-quotes
If (Mid(fp_sQry, fp_iStart - 1, 1) = """") Then
fp_sValue = Replace(fp_sValue, """", """""")
ElseIf (Mid(fp_sQry, fp_iStart - 1, 1) = "'") Then
fp_sValue = Replace(fp_sValue, "'", "''")
End If
If (len(fp_sValue) = 0) Then fp_bBlankField = True
fp_sQry = Left(fp_sQry, fp_iStart - 1) & fp_sValue & Right(fp_sQry, Len(fp_sQry) - fp_iEnd - 1)
' Fixup the new current position to be after the substituted value
fp_iCurrent = fp_iStart + Len(fp_sValue)
End If
Loop
' establish connection
If Not fp_fError Then
if Application(fp_sDataConn & "_ConnectionString") = "" then
Err.Description = "The database connection named '" & fp_sDataConn & "' is undefined.<br><br>"
Err.Description = Err.Description & "This problem can occur if:<br>"
Err.Description = Err.Description & "* the connection has been removed from the web<br>"
Err.Description = Err.Description & "* the file 'global.asa' is missing or contains errors<br>"
Err.Description = Err.Description & "* the root folder does not have Scripting permissions enabled<br>"
Err.Description = Err.Description & "* the web is not marked as an Application Root<br>"
fp_fError = True
end if
if Not fp_fError then
set fp_conn = Server.CreateObject("ADODB .Connectio n")
fp_conn.ConnectionTimeout = Application(fp_sDataConn & "_ConnectionTimeout")
fp_conn.CommandTimeout = Application(fp_sDataConn & "_CommandTimeout")
fp_sConn = Application(fp_sDataConn & "_ConnectionString")
fp_sUid = Application(fp_sDataConn & "_RuntimeUserName")
fp_sPwd = Application(fp_sDataConn & "_RuntimePassword")
Err.Clear
FP_OpenConnection fp_conn, fp_sConn, fp_sUid, fp_sPwd, Not(fp_fCustomQuery)
if Err.Description <> "" then fp_fError = True
end if
if Not fp_fError then
set fp_cmd = Server.CreateObject("ADODB .Command")
fp_cmd.CommandText = fp_sQry
fp_cmd.CommandType = fp_iCommandType
set fp_cmd.ActiveConnection = fp_conn
set fp_rs = Server.CreateObject("ADODB .Recordset ")
set fp_rs.Source = fp_cmd
If fp_iCommandType = 4 Then
fp_cmd.Parameters.Refresh
Do Until Len(fp_sInputs) = 0
fp_iLoc = InStr(fp_sInputs,"=")
if fp_iLoc = 0 then exit do
fp_sKey = Left(fp_sInputs,fp_iLoc - 1)
fp_sInputs = Mid(fp_sInputs,fp_iLoc + 1)
fp_iLoc = InStr(fp_sInputs,"&")
if fp_iLoc = 0 then
fp_sInpVal = fp_sInputs
fp_sInputs = ""
else
fp_sInpVal = Left(fp_sInputs,fp_iLoc - 1)
fp_sInputs = Mid(fp_sInputs,fp_iLoc + 1)
end if
fp_sVal = Request.Form(fp_sKey)
if len(fp_sVal) = 0 then fp_sVal = Request.QueryString(fp_sKe y)
if len(fp_sVal) = 0 then fp_sVal = fp_sInpVal
fp_pType = fp_cmd.Parameters(fp_sKey) .Type
select case fp_pType
case 129, 200, 201, 130, 202, 203 ' adChar, adVarChar, adLongVarChar, adWChar, adVarWChar, adLongVarWChar
fp_cmd.Parameters(fp_sKey) .Size = Len(fp_sVal) + 1
case else
' do nothing
end select
' remember names and values used in query
if not fp_dictInputs.Exists(fp_sK ey) then
fp_dictInputs.Add fp_sKey, fp_sVal
end if
fp_cmd.Parameters(fp_sKey) = fp_sVal
Loop
End If
If fp_iMaxRecords <> 0 Then fp_rs.MaxRecords = fp_iMaxRecords
FP_SetCursorProperties(fp_ rs)
FP_OpenRecordset(fp_rs)
end if
If Err.Description <> "" Then
if fp_fTableFormat then
Response.Write "<tr><td colspan=" & fp_iDisplayCols & " color=#000000 bgcolor=#ffff00>"
end if
Response.Write "<tt>"
Response.Write "<b>Database Results Error</b><br>"
if Not fp_fError then
Response.Write "<i>Description:</i> " & Err.Description & "<br>"
Response.Write "<i>Number:</i> " & Err.Number & " (0x" & Hex(Err.Number) & ")<br>"
Response.Write "<i>Source:</i> " & Err.Source & "<br>"
else
Response.Write Err.Description
end if
if fp_bBlankField Then
Response.Write "<br>One or more form fields were empty."
Response.Write " You should provide default values for all form fields that are used in the query."
End If
Response.Write "</tt>"
if fp_fTableFormat then
Response.Write "</td></tr>"
end if
fp_fError = True
Else
' Check for the no-record case
if fp_rs.State <> 1 then
fp_fError = True
Response.Write fp_sNoRecords
ElseIf fp_rs.EOF And fp_rs.BOF Then
fp_fError = True
Response.Write fp_sNoRecords
end if
end if
end if
' determine whether or not provider supports Absolute Positioning
if not fp_fError then
if IsObject(fp_rs) and not(fp_rs.Supports(&H00004 000)) then
fp_iPageSize = 0
fp_fShowNavbar = False
end if
end if
' move to correct position in result set
if not fp_fError then
if fp_iPageSize > 0 then
fp_iAbsPage = 1
fp_sVal = Session(fp_sEnvKey)
if fp_sVal <> "" then
fp_iAbsPage = CInt(fp_sVal)
end if
fp_rs.PageSize = fp_iPageSize
if fp_iAbsPage > fp_rs.PageCount then fp_iAbsPage = fp_rs.PageCount
fp_rs.AbsolutePage = fp_iAbsPage
if fp_rs.PageCount = 1 then fp_fShowNavbar = False
select case fp_sMoveType
case ""
' do nothing
case fp_sFirstLabel
fp_rs.AbsolutePage = 1
case fp_sPrevLabel
if fp_rs.AbsolutePage > 1 then fp_rs.AbsolutePage = fp_rs.AbsolutePage - 1
case fp_sNextLabel
if fp_rs.AbsolutePage < fp_rs.PageCount then fp_rs.AbsolutePage = fp_rs.AbsolutePage + 1
case fp_sLastLabel
fp_rs.AbsolutePage = fp_rs.PageCount
case else
' do nothing
end select
fp_iAbsPage = fp_rs.AbsolutePage
Session(fp_sEnvKey) = fp_iAbsPage
end if
end if
if fp_fError then fp_fShowNavbar = False
fp_iCount = 0
Do
if fp_fError then exit do
if fp_rs.EOF then exit do
if fp_iPageSize > 0 And fp_iCount >= fp_rs.PageSize then exit do
if fp_iMaxRecords > 0 And fp_iCount >= fp_iMaxRecords then
' MaxRecords didn't work; exit loop
fp_fShowNavbar = False
exit do
end if
%>
What we need to do is to repalce a few files on your webserver. With FrontPage open click on Tools, Web Settings, Parameters and check the box to display hidden files and folders. Say yes to refresh the site.
You will then see a directory name _fpclass, open this directory and export all the files in there to some place to protect them as we are going to replace them.
Here are two files you will need to copy them to notepad and then save them with the file names at the beginning of the code. Then copy them into the _fpclass directory and replace the existing files.
All should work then.
RCMB
fpdblib.inc
<%
Sub FP_SetLocaleForPage
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Err.Clear
if FP_CodePage <> 0 then
Session.CodePage = FP_CodePage
if Err.Number <> 0 then Session.CodePage = Session("FP_OldCodePage")
end if
Err.Clear
if FP_LCID <> 0 then
Session.LCID = FP_LCID
if Err.Number <> 0 then Session.LCID = Session("FP_OldLCID")
end if
End Sub
Sub FP_RestoreLocaleForPage
On Error Resume Next
if Session("FP_OldCodePage") <> 0 then
Session.CodePage = Session("FP_OldCodePage")
end if
if Session("FP_OldLCID") <> 0 then
Session.LCID = Session("FP_OldLCID")
end if
Err.Clear
End Sub
Function FP_HTMLEncode(str)
FP_HTMLEncode = str
FP_HTMLEncode = Replace(FP_HTMLEncode,"&",
FP_HTMLEncode = Server.HTMLEncode(FP_HTMLE
FP_HTMLEncode = Replace(FP_HTMLEncode,"^^@
End Function
Function FP_FieldVal(rs, fldname)
FP_FieldVal = FP_HTMLEncode(FP_Field(rs,
if FP_FieldVal = "" then FP_FieldVal = " "
End Function
Function FP_Field(rs, fldname)
If Not IsEmpty(rs) And Not (rs Is Nothing) and Not IsNull(rs(fldname)) Then
Select Case rs(fldname).Type
Case 128, 204, 205 ' adBinary, adVarBinary, adLongVarBinary
FP_Field = "[#BINARY#]"
Case 201, 203 ' adLongVarChar, adLongVarWChar
if rs(fldname).DefinedSize > 255 then
' check for Access hyperlink fields (only absolute http links)
fp_strVal = rs(fldname)
fp_idxHash1 = InStr(LCase(fp_strVal),"#http://"
if fp_idxHash1 > 0 then
fp_idxHash2 = InStr(fp_idxHash1+1,fp_str
if fp_idxHash2 > 0 then
' this is an Access hyperlink; extract the URL part
fp_strVal = Mid(fp_strVal,fp_idxHash1+
if Right(fp_strVal,1) = "#" then
fp_strVal = Left(fp_strVal,Len(fp_strV
end if
end if
end if
FP_Field = fp_strVal
else
FP_Field = rs(fldname)
end if
Case Else
FP_Field = rs(fldname)
End Select
Else
FP_Field = ""
End If
End Function
Function FP_FieldHTML(rs, fldname)
FP_FieldHTML = FP_HTMLEncode(FP_Field(rs,
End Function
Function FP_FieldURL(rs, fldname)
FP_FieldURL = Server.URLEncode(FP_Field(
End Function
Function FP_FieldLink(rs, fldname)
FP_FieldLink = Replace(FP_Field(rs, fldname), " ", "%20")
End Function
Sub FP_OpenConnection(oConn, sAttrs, sUID, sPWD, fMSAccessReadOnly)
Dim sTmp
Dim sConnStr
Dim fIsAccessDriver
fIsAccessDriver = (InStr(LCase(sAttrs), "microsoft access driver") > 0)
sConnStr = FP_RemoveDriverWithDSN(sAt
sTmp = sConnStr
On Error Resume Next
If fMSAccessReadOnly And fIsAccessDriver Then
sTmp = sTmp & ";Exclusive=1;ReadOnly=1"
Err.Clear
oConn.Open sTmp, sUID, sPWD
If Err.Description = "" Then Exit Sub
End If
Err.Clear
oConn.Open sConnStr, sUID, sPWD
End Sub
Function FP_RemoveDriverWithDSN(sAt
FP_RemoveDriverWithDSN = sAttrs
sDrv = "driver="
sDSN = "dsn="
sLC = LCase(sAttrs)
if InStr(sLC, sDSN) < 1 then exit function
idxFirst = InStr(sLC, sDrv)
if idxFirst < 1 then exit function
idxBeg = idxFirst + Len(sDrv)
if Mid(sLC,idxBeg,1) = "{" then
idxEnd = InStr(idxBeg, sLC, "}")
if idxEnd > 0 and Mid(sLC,idxEnd+1,1) = ";" then
idxEnd = idxEnd + 1
end if
else
idxEnd = InStr(idxBeg, sLC, ";")
end if
if idxEnd < 1 then idxEnd = Len(sLC)
FP_RemoveDriverWithDSN = Left(sAttrs,idxFirst-1) & Mid(sAttrs,idxEnd+1)
End Function
Sub FP_OpenRecordset(rs)
On Error Resume Next
rs.Open
End Sub
Function FP_ReplaceQuoteChars(sQry)
Dim sIn
Dim sOut
Dim idx
sIn = sQry
sOut = ""
idx = InStr(sIn, "%%")
Do While (idx > 0)
sOut = sOut & Left(sIn, idx - 1)
sIn = Mid(sIn, idx + 2)
if (Left(sIn,1) = "%") And (Left(sIn,2) <> "%%") then
sIn = Mid(sIn, 2)
sOut = sOut & "%"
end if
sOut = sOut & "::"
idx = InStr(sIn, "%%")
if idx > 0 then
sOut = sOut & Left(sIn, idx - 1)
sIn = Mid(sIn, idx + 2)
sOut = sOut & "::"
if (Left(sIn,1) = "%") And (Left(sIn,2) <> "%%") then
sIn = Mid(sIn, 2)
sOut = sOut & "%"
end if
end if
idx = InStr(sIn, "%%")
Loop
sOut = sOut & sIn
FP_ReplaceQuoteChars = sOut
End Function
Sub FP_Close(obj)
On Error Resume Next
obj.Close
End Sub
Sub FP_SetCursorProperties(rs)
On Error Resume Next
rs.CursorLocation = 3 ' adUseClient
rs.CursorType = 3 ' adOpenStatic
End Sub
%>
fpdbrgn1.inc
<%
FP_SetLocaleForPage
' determine whether or not to provide navigation controls
if fp_iPageSize > 0 then
fp_fShowNavbar = True
else
fp_fShowNavbar = False
end if
fp_sPagePath = Request.ServerVariables("P
fp_sEnvKey = fp_sPagePath & "#fpdbr_" & fp_iRegion
fp_sFormName = "fpdbr_" & CStr(fp_iRegion)
fp_sFormKey = fp_sFormName & "_PagingMove"
fp_sInputs = fp_sDefault
fp_sFirstLabel = " |< "
fp_sPrevLabel = " < "
fp_sNextLabel = " > "
fp_sLastLabel = " >| "
fp_sDashLabel = " -- "
if not IsEmpty(Request(fp_sFormKe
fp_sMoveType = Request(fp_sFormKey)
else
fp_sMoveType = ""
end if
fp_iCurrent=1
fp_fError=False
fp_bBlankField=False
Set fp_dictInputs = Server.CreateObject("Scrip
fp_sQry = FP_ReplaceQuoteChars(fp_sQ
' replace any input parameters in query string
Do While (Not fp_fError) And (InStr(fp_iCurrent, fp_sQry, "::") <> 0)
' found a opening quote, find the close quote
fp_iStart = InStr(fp_iCurrent, fp_sQry, "::")
fp_iEnd = InStr(fp_iStart + 2, fp_sQry, "::")
If fp_iEnd = 0 Then
fp_fError = True
Response.Write "<B>Database Results Error: mismatched parameter delimiters</B>"
Else
fp_sField = Mid(fp_sQry, fp_iStart + 2, fp_iEnd - fp_iStart - 2)
fp_sValue = Request.Form(fp_sField)
if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sFi
' if the named form field doesn't exist, make a note of it
If (len(fp_sValue) = 0) Then
fp_iStartField = InStr(fp_sDefault, fp_sField & "=")
if fp_iStartField > 0 then
fp_iStartField = fp_iStartField + len(fp_sField) + 1
fp_iEndField = InStr(fp_iStartField,fp_sD
if fp_iEndField > 0 then
fp_sValue = Mid(fp_sDefault,fp_iStartF
else
fp_sValue = Mid(fp_sDefault,fp_iStartF
end if
end if
End If
' remember names and values used in query
if not fp_dictInputs.Exists(fp_sF
fp_dictInputs.Add fp_sField, fp_sValue
end if
' this next finds the named form field value, and substitutes in
' doubled single-quotes for all single quotes in the literal value
' so that SQL doesn't get confused by seeing unpaired single-quotes
If (Mid(fp_sQry, fp_iStart - 1, 1) = """") Then
fp_sValue = Replace(fp_sValue, """", """""")
ElseIf (Mid(fp_sQry, fp_iStart - 1, 1) = "'") Then
fp_sValue = Replace(fp_sValue, "'", "''")
End If
If (len(fp_sValue) = 0) Then fp_bBlankField = True
fp_sQry = Left(fp_sQry, fp_iStart - 1) & fp_sValue & Right(fp_sQry, Len(fp_sQry) - fp_iEnd - 1)
' Fixup the new current position to be after the substituted value
fp_iCurrent = fp_iStart + Len(fp_sValue)
End If
Loop
' establish connection
If Not fp_fError Then
if Application(fp_sDataConn & "_ConnectionString") = "" then
Err.Description = "The database connection named '" & fp_sDataConn & "' is undefined.<br><br>"
Err.Description = Err.Description & "This problem can occur if:<br>"
Err.Description = Err.Description & "* the connection has been removed from the web<br>"
Err.Description = Err.Description & "* the file 'global.asa' is missing or contains errors<br>"
Err.Description = Err.Description & "* the root folder does not have Scripting permissions enabled<br>"
Err.Description = Err.Description & "* the web is not marked as an Application Root<br>"
fp_fError = True
end if
if Not fp_fError then
set fp_conn = Server.CreateObject("ADODB
fp_conn.ConnectionTimeout = Application(fp_sDataConn & "_ConnectionTimeout")
fp_conn.CommandTimeout = Application(fp_sDataConn & "_CommandTimeout")
fp_sConn = Application(fp_sDataConn & "_ConnectionString")
fp_sUid = Application(fp_sDataConn & "_RuntimeUserName")
fp_sPwd = Application(fp_sDataConn & "_RuntimePassword")
Err.Clear
FP_OpenConnection fp_conn, fp_sConn, fp_sUid, fp_sPwd, Not(fp_fCustomQuery)
if Err.Description <> "" then fp_fError = True
end if
if Not fp_fError then
set fp_cmd = Server.CreateObject("ADODB
fp_cmd.CommandText = fp_sQry
fp_cmd.CommandType = fp_iCommandType
set fp_cmd.ActiveConnection = fp_conn
set fp_rs = Server.CreateObject("ADODB
set fp_rs.Source = fp_cmd
If fp_iCommandType = 4 Then
fp_cmd.Parameters.Refresh
Do Until Len(fp_sInputs) = 0
fp_iLoc = InStr(fp_sInputs,"=")
if fp_iLoc = 0 then exit do
fp_sKey = Left(fp_sInputs,fp_iLoc - 1)
fp_sInputs = Mid(fp_sInputs,fp_iLoc + 1)
fp_iLoc = InStr(fp_sInputs,"&")
if fp_iLoc = 0 then
fp_sInpVal = fp_sInputs
fp_sInputs = ""
else
fp_sInpVal = Left(fp_sInputs,fp_iLoc - 1)
fp_sInputs = Mid(fp_sInputs,fp_iLoc + 1)
end if
fp_sVal = Request.Form(fp_sKey)
if len(fp_sVal) = 0 then fp_sVal = Request.QueryString(fp_sKe
if len(fp_sVal) = 0 then fp_sVal = fp_sInpVal
fp_pType = fp_cmd.Parameters(fp_sKey)
select case fp_pType
case 129, 200, 201, 130, 202, 203 ' adChar, adVarChar, adLongVarChar, adWChar, adVarWChar, adLongVarWChar
fp_cmd.Parameters(fp_sKey)
case else
' do nothing
end select
' remember names and values used in query
if not fp_dictInputs.Exists(fp_sK
fp_dictInputs.Add fp_sKey, fp_sVal
end if
fp_cmd.Parameters(fp_sKey)
Loop
End If
If fp_iMaxRecords <> 0 Then fp_rs.MaxRecords = fp_iMaxRecords
FP_SetCursorProperties(fp_
FP_OpenRecordset(fp_rs)
end if
If Err.Description <> "" Then
if fp_fTableFormat then
Response.Write "<tr><td colspan=" & fp_iDisplayCols & " color=#000000 bgcolor=#ffff00>"
end if
Response.Write "<tt>"
Response.Write "<b>Database Results Error</b><br>"
if Not fp_fError then
Response.Write "<i>Description:</i> " & Err.Description & "<br>"
Response.Write "<i>Number:</i> " & Err.Number & " (0x" & Hex(Err.Number) & ")<br>"
Response.Write "<i>Source:</i> " & Err.Source & "<br>"
else
Response.Write Err.Description
end if
if fp_bBlankField Then
Response.Write "<br>One or more form fields were empty."
Response.Write " You should provide default values for all form fields that are used in the query."
End If
Response.Write "</tt>"
if fp_fTableFormat then
Response.Write "</td></tr>"
end if
fp_fError = True
Else
' Check for the no-record case
if fp_rs.State <> 1 then
fp_fError = True
Response.Write fp_sNoRecords
ElseIf fp_rs.EOF And fp_rs.BOF Then
fp_fError = True
Response.Write fp_sNoRecords
end if
end if
end if
' determine whether or not provider supports Absolute Positioning
if not fp_fError then
if IsObject(fp_rs) and not(fp_rs.Supports(&H00004
fp_iPageSize = 0
fp_fShowNavbar = False
end if
end if
' move to correct position in result set
if not fp_fError then
if fp_iPageSize > 0 then
fp_iAbsPage = 1
fp_sVal = Session(fp_sEnvKey)
if fp_sVal <> "" then
fp_iAbsPage = CInt(fp_sVal)
end if
fp_rs.PageSize = fp_iPageSize
if fp_iAbsPage > fp_rs.PageCount then fp_iAbsPage = fp_rs.PageCount
fp_rs.AbsolutePage = fp_iAbsPage
if fp_rs.PageCount = 1 then fp_fShowNavbar = False
select case fp_sMoveType
case ""
' do nothing
case fp_sFirstLabel
fp_rs.AbsolutePage = 1
case fp_sPrevLabel
if fp_rs.AbsolutePage > 1 then fp_rs.AbsolutePage = fp_rs.AbsolutePage - 1
case fp_sNextLabel
if fp_rs.AbsolutePage < fp_rs.PageCount then fp_rs.AbsolutePage = fp_rs.AbsolutePage + 1
case fp_sLastLabel
fp_rs.AbsolutePage = fp_rs.PageCount
case else
' do nothing
end select
fp_iAbsPage = fp_rs.AbsolutePage
Session(fp_sEnvKey) = fp_iAbsPage
end if
end if
if fp_fError then fp_fShowNavbar = False
fp_iCount = 0
Do
if fp_fError then exit do
if fp_rs.EOF then exit do
if fp_iPageSize > 0 And fp_iCount >= fp_rs.PageSize then exit do
if fp_iMaxRecords > 0 And fp_iCount >= fp_iMaxRecords then
' MaxRecords didn't work; exit loop
fp_fShowNavbar = False
exit do
end if
%>
The problem is a known issue with Microsoft and when you attempt to update a database containing numbers from a FP2003 generated site you will receive the error you are seeing. If you just copy the files from FP2002 all works fine.
RCMB
RCMB
David -
If you need to verify the name prior to submission then we need to combine pages one and two which is much easier to work with.
Post the code from page one and two here and I will modify to make one page that will first display the drop down (employee number) and then on select display the users name information. Then when they click on submit it will post the data to page 3 and write to the database.
RCMB
If you need to verify the name prior to submission then we need to combine pages one and two which is much easier to work with.
Post the code from page one and two here and I will modify to make one page that will first display the drop down (employee number) and then on select display the users name information. Then when they click on submit it will post the data to page 3 and write to the database.
RCMB
ASKER
Wow! Nice!
You did it!
Two more things (I will give you the points whether or not you can help me here.
You definately earned them) Is it possible that when the number is selected the user
First and last name become visible so that they have a little more confidence submiting their
Entry?
And secondly
(not as important as the previous request) Is it possible that once a certain amount of records
are submited, a message shows on the registration page saying that the class is full and provides
them a link to a differnt page? Or how would you suggest handling full classes?
You did it!
Two more things (I will give you the points whether or not you can help me here.
You definately earned them) Is it possible that when the number is selected the user
First and last name become visible so that they have a little more confidence submiting their
Entry?
And secondly
(not as important as the previous request) Is it possible that once a certain amount of records
are submited, a message shows on the registration page saying that the class is full and provides
them a link to a differnt page? Or how would you suggest handling full classes?
On the first item it is very easy so see the last note I posted.
For the second issue all we need to do is a record count. I am going to make an assumption that somewhere the data is stored as to what class they are registering for (hopefully in the register table).
What we will need to do on the second page is to create a database results wizard (do this before the other area) to do something like:
SELECT Count(EmpNum) AS RecCount WHERE CLASS='::Class::' and ClassDate=#::ClassDate::#
At the end of your database start region (like we did when we assigned the variables earlier) assign a new variable <% varRecCount = fp_rs("RecCount") %>
Then after the entire database results region and before the region that does the SELECT * FROM ... WHERE EmpNum = ::EmpNum:: do this
<% If varRecCount < 100 Then %>
do the select statement
<% Else %>
This class is full. Please click <a href="classrequest.htm">he re</a> to return to the class request form page.
<% End if %>
Hopefully you get the idea.
R/RCMB
For the second issue all we need to do is a record count. I am going to make an assumption that somewhere the data is stored as to what class they are registering for (hopefully in the register table).
What we will need to do on the second page is to create a database results wizard (do this before the other area) to do something like:
SELECT Count(EmpNum) AS RecCount WHERE CLASS='::Class::' and ClassDate=#::ClassDate::#
At the end of your database start region (like we did when we assigned the variables earlier) assign a new variable <% varRecCount = fp_rs("RecCount") %>
Then after the entire database results region and before the region that does the SELECT * FROM ... WHERE EmpNum = ::EmpNum:: do this
<% If varRecCount < 100 Then %>
do the select statement
<% Else %>
This class is full. Please click <a href="classrequest.htm">he
<% End if %>
Hopefully you get the idea.
R/RCMB
ASKER
Very Very Nice!
Thank you so much. You make Frontpage much easier to use.
God Bless You
~David
Thank you so much. You make Frontpage much easier to use.
God Bless You
~David
ASKER
Hey you second guessed me.. I did'nt notice that you had allready sugested that. :-)
Page 1
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Register For Class</title>
</head>
<body>
<form action="page2.asp">
<nobr>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-columntypes="3,202,200,2 00,200,202 ,202,202,2 02,202,200 ,200,200,2 00,200,200 ,200,200,2 00" s-dataconnection="TA-UPDAT E" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="EmployeeNumb er" s-menuvalue="EmployeeNumbe r" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Students" s-displaycolumns="Employee Number,Las tName" s-criteria s-order="[EmployeeNumber] +" s-sql="SELECT * FROM Students ORDER BY EmployeeNumber ASC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Da tabase< /span> " b-InForm="TRUE" b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="FALSE" startspan --><!--#include file="../_fpclass/fpdblib. inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students ORDER BY EmployeeNumber ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="EmployeeNu mber"
fp_sMenuValue="EmployeeNum ber"
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="9407" --><select NAME="EmployeeNumber" SIZE="1">
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd brgn1.inc" startspan --><!--#include file="../_fpclass/fpdbrgn1 .inc"--><! --webbot bot="AspInclude" endspan i-checksum="52766" -->
<option><%=FP_FieldHTML(fp _rs,"Emplo yeeNumber" )%></optio n>
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd brgn2.inc" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"--><! --webbot bot="AspInclude" endspan i-checksum="52830" -->
</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Re sults</ span> " startspan --><!--webbot bot="DatabaseRegionEnd" endspan --><input type="submit" value="Submit" name="B1"></nobr></form>
</body>
</html>
Page 2
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-columntypes="3,202,200,2 00,200,202 ,202,202,2 02,202,200 ,200,200,2 00,200,200 ,200,200,2 00" s-dataconnection="TA-UPDAT E" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Students" s-displaycolumns="Employee Number" s-criteria="[EmployeeNumbe r] EQ {EmployeeNumber} +" s-order s-sql="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="EmployeeN umber=" s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the start of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdblib. inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe r="
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1 .inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="50921" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-column="EmployeeNumber" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&am p;lt;& lt;</fo nt>Empl oyeeNumber <font size="-1">&am p;gt;& gt;</fo nt>" startspan --><%=FP_FieldVal(fp_rs,"E mployeeNum ber")%><!- -webbot bot="DatabaseResultColumn" endspan i-checksum="41846" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
<%=varLname%><br>
<%=varFname%><br>
<%=varEmpNum%><br>
<%=varEmail%>
</body>
</html>
Page 1
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Register For Class</title>
</head>
<body>
<form action="page2.asp">
<nobr>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students ORDER BY EmployeeNumber ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="EmployeeNu
fp_sMenuValue="EmployeeNum
fp_sColTypes="&StudentID=3
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="9407" --><select NAME="EmployeeNumber" SIZE="1">
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd
<option><%=FP_FieldHTML(fp
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd
</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../_fpclass/fpdb
</body>
</html>
Page 2
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="50921" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td>
<!--webbot bot="DatabaseResultColumn"
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<% response.redirect "page3.asp?LastName=" & varLname & "&FirstName=" & varFname & "&EmployeeNumber=" & varEmpNum & "&Email=" & varEmail %>
<%=varLname%><br>
<%=varFname%><br>
<%=varEmpNum%><br>
<%=varEmail%>
</body>
</html>
Okay this may require a little tweaking but it should work. Replace all of page1.asp with this: (note you will no longer need page2.asp)
Here is what happens - You open page 1 and the form displays a drop down list of all employees, you select your number and the page reloads page 1 with the information corresponding to the number selected. If you click on yes the form submits your data to page3.asp and then writes the data and redirects you to wherever. Man I love a challenge!!! ;-)
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Register For Class</title>
</head>
<body>
<% If request("Submit") <> "" Then %>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-columntypes="3,202,200,2 00,200,202 ,202,202,2 02,202,200 ,200,200,2 00,200,200 ,200,200,2 00" s-dataconnection="TA-UPDAT E" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Students" s-displaycolumns="Employee Number" s-criteria="[EmployeeNumbe r] EQ {EmployeeNumber} +" s-order s-sql="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="EmployeeN umber=" s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; align="left" width="100%"> <font color="#000000"& gt;This is the start of a Database Results region. The region will not work unless the page has a file extension of ".asp".</font ></t d></ tr>" startspan --><!--#include file="fpweb:///_fpclass/fp dblib.inc" -->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe r="
fp_sNoRecords="<tr><td colspan=1 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="fpweb:///_fpclass/fp dbrgn1.inc "-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="61715" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td width="50%">Last Name</td>
<td width="50%"><%=fp_rs("Last Name")%></ td>
</tr>
<tr>
<td width="50%">First Name
<td width="50%"><%=fp_rs("Firs tName")%>< /td>
</tr>
<tr>
<td width="50%">Employee Number
<td width="50%"><%=fp_rs("Empl oyeeNumber ")%></td>
</tr>
<tr>
<td width="50%">Email Address
<td width="50%"><%=fp_rs("Emai l")%></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center">Is this information correct?</td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" ; align="left" width="100%"> <font color="#000000"& gt;This is the end of a Database Results region.</font></t d></ tr>" startspan --><!--#include file="fpweb:///_fpclass/fp dbrgn2.inc "-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="23298" --></tbody>
</table>
<table align="center">
<tr>
<td>
<form action="page3.asp">
<input type="hidden" value="<%=varLname%>" name="LastName">
<input type="hidden" value="<%=varFname%>" name="FirstName">
<input type="hidden" value="<%=varEmpNum%>" name="EmployeeNumber">
<input type="hidden" value="<%=varEmail%>" name="Email">
<input type="submit" value="Yes - Continue With Registraton" name="SubmitReg">
</form>
</td>
<td>
<form action="javascript:history .go(-1)">
<input type="submit" value="No - Return to Selection Form" name="Return">
</form>
</td>
</tr>
</table>
<% Else %>
<form action="page1.asp">
<nobr>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E mployeeNum ber,FirstN ame,LastNa me,Address ,City,Stat eOrProvinc e,PostalCo de,PhoneNu mber,Major ,Email,Thi rdName,Fou rthName,Ad dress1,Add ress2,Town ,State,Zip ,PhoneExte nsion" s-columntypes="3,202,200,2 00,200,202 ,202,202,2 02,202,200 ,200,200,2 00,200,200 ,200,200,2 00" s-dataconnection="TA-UPDAT E" b-tableformat="FALSE" b-menuformat="TRUE" s-menuchoice="EmployeeNumb er" s-menuvalue="EmployeeNumbe r" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Students" s-displaycolumns="Employee Number,Las tName" s-criteria s-order="[EmployeeNumber] +" s-sql="SELECT * FROM Students ORDER BY EmployeeNumber ASC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="0" i-groupsize="0" botid="1" u-dblib="../_fpclass/fpdbl ib.inc" u-dbrgn1="../_fpclass/fpdb rgn1.inc" u-dbrgn2="../_fpclass/fpdb rgn2.inc" preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Da tabase< /span> " b-InForm="TRUE" b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="FALSE" startspan --><!--#include file="fpweb:///_fpclass/fp dblib.inc" -->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students ORDER BY EmployeeNumber ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="EmployeeNu mber"
fp_sMenuValue="EmployeeNum ber"
fp_sColTypes="&StudentID=3 &EmployeeN umber=202& FirstName= 200&LastNa me=200&Add ress=200&C ity=202&St ateOrProvi nce=202&Po stalCode=2 02&PhoneNu mber=202&M ajor=202&E mail=200&T hirdName=2 00&FourthN ame=200&Ad dress1=200 &Address2= 200&Town=2 00&State=2 00&Zip=200 &PhoneExte nsion=200& "
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="27137" --><select NAME="EmployeeNumber" SIZE="1">
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd brgn1.inc" startspan --><!--#include file="../_fpclass/fpdbrgn1 .inc"--><! --webbot bot="AspInclude" endspan i-checksum="52766" -->
<option><%=FP_FieldHTML(fp _rs,"Emplo yeeNumber" )%></optio n>
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd brgn2.inc" startspan --><!--#include file="../_fpclass/fpdbrgn2 .inc"--><! --webbot bot="AspInclude" endspan i-checksum="52830" -->
</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../_fpclass/fpdb rgn2.inc" i-groupsize="0" clientside preview=" <span style="color: rgb(0,0,0); background-color: rgb(255,255,0)">Re sults</ span> " startspan --><!--webbot bot="DatabaseRegionEnd" endspan -->
<input type="submit" value="Submit" name="Submit"></nobr></for m>
<% End if %>
</body>
</html>
Here is what happens - You open page 1 and the form displays a drop down list of all employees, you select your number and the page reloads page 1 with the information corresponding to the number selected. If you click on yes the form submits your data to page3.asp and then writes the data and redirects you to wherever. Man I love a challenge!!! ;-)
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Register For Class</title>
</head>
<body>
<% If request("Submit") <> "" Then %>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students WHERE (EmployeeNumber = '::EmployeeNumber::')"
fp_sDefault="EmployeeNumbe
fp_sNoRecords="<tr><td colspan=1 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&StudentID=3
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="fpweb:///_fpclass/fp
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="61715" -->
<%
'Add additional fields as necessary
varLname = fp_rs("LastName")
varFname = fp_rs("FirstName")
varEmpNum = fp_rs("EmployeeNumber")
varEmail = fp_rs("Email")
%>
<tr>
<td width="50%">Last Name</td>
<td width="50%"><%=fp_rs("Last
</tr>
<tr>
<td width="50%">First Name
<td width="50%"><%=fp_rs("Firs
</tr>
<tr>
<td width="50%">Employee Number
<td width="50%"><%=fp_rs("Empl
</tr>
<tr>
<td width="50%">Email Address
<td width="50%"><%=fp_rs("Emai
</tr>
<tr>
<td width="100%" colspan="2" align="center">Is this information correct?</td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdb
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="23298" --></tbody>
</table>
<table align="center">
<tr>
<td>
<form action="page3.asp">
<input type="hidden" value="<%=varLname%>" name="LastName">
<input type="hidden" value="<%=varFname%>" name="FirstName">
<input type="hidden" value="<%=varEmpNum%>" name="EmployeeNumber">
<input type="hidden" value="<%=varEmail%>" name="Email">
<input type="submit" value="Yes - Continue With Registraton" name="SubmitReg">
</form>
</td>
<td>
<form action="javascript:history
<input type="submit" value="No - Return to Selection Form" name="Return">
</form>
</td>
</tr>
</table>
<% Else %>
<form action="page1.asp">
<nobr>
<!--webbot bot="DatabaseRegionStart" s-columnnames="StudentID,E
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Students ORDER BY EmployeeNumber ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="TA-UPDATE"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="EmployeeNu
fp_sMenuValue="EmployeeNum
fp_sColTypes="&StudentID=3
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="27137" --><select NAME="EmployeeNumber" SIZE="1">
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd
<option><%=FP_FieldHTML(fp
<!--webbot bot="AspInclude" clientside u-incfile="../_fpclass/fpd
</select><!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="TRUE" u-dbrgn2="../_fpclass/fpdb
<input type="submit" value="Submit" name="Submit"></nobr></for
<% End if %>
</body>
</html>
ASKER
Very Nice!
You are the guru!
Thanks Again!
~David
You are the guru!
Thanks Again!
~David
ASKER
I really appreciate this code, this is great!
glad all is working. if you need more help let me know.
R/Curtis
R/Curtis
ASKER
RCMB,
I wondered if you interested in tweeking this page or extending it.
I have asked a new question here:
https://www.experts-exchange.com/questions/21088182/Question-Continued-from-previous-class-registration-question.html
Let me know.
Thanks Again
~David
I wondered if you interested in tweeking this page or extending it.
I have asked a new question here:
https://www.experts-exchange.com/questions/21088182/Question-Continued-from-previous-class-registration-question.html
Let me know.
Thanks Again
~David
In your first form is the form only displaying a single drop-down with the employees number and then do you desire this to submit to another form with the emplyees information so the employee can update their data?
--OR--
Is your first form listing all of this data and you just desire to have it updated?
RCMB