|
| |
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
Hyperlinks within the DRW - 6/28/2005 13:22:23
I have a question. I have a page that displays all the records I have in an SQL db by using the DRW. Each record has a unique id which is hyperlinked. The link points to nothing currently, but I wanted to know if it is possible to send that link to another page where it will display an update form which was also created by using the DRW? So you could click on the Reference_Number and it takes you directly to an update page for that record. Is that possible? Thanks in advance for any feedback.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 6/28/2005 14:01:42
I'll need a little more clarification. I'm new to using the DRW. Here is the code where the records are displayed. Can you be a little more specific for me? Thanks.
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Public Inquiries Query</title>
</head>
<body>
<p align="center"><b><font size="5">Public Inquiries Records</font></b></p>
<table width="100%" border="1">
<thead>
<tr>
<td><b>Reference_Number</b></td>
<td><b>Date</b></td>
<td><b>Category</b></td>
<td><b>Inquirer_name</b></td>
<td><b>Inquirer_city</b></td>
<td><b>Inquirer_state</b></td>
<td><b>Topic</b></td>
<td><b>Response</b></td>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-columntypes="131,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129" s-dataconnection="Public_Inquiry" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="Reference_Number" s-menuvalue="Reference_Number" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="5" b-makeform="FALSE" s-recordsource="Inquiry" s-displaycolumns="Reference_Number,Date,Category,Inquirer_name,Inquirer_city,Inquirer_state,Topic,Response" s-criteria s-order s-sql="SELECT * FROM Inquiry" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="../../_fpclass/fpdblib.inc" u-dbrgn1="../../_fpclass/fpdbrgn1.inc" u-dbrgn2="../../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" b-WasTableFormat="TRUE" 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 Inquiry"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=8 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Public_Inquiry"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Reference_Number"
fp_sMenuValue="Reference_Number"
fp_iDisplayCols=8
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="58111" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Reference_Number" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="TRUE" clientside b-MenuFormat preview="<font size="-1"><<</font><a href=".">Reference_Number</a><font size="-1">>></font>" startspan --><%="<a href=""" & FP_FieldLink(fp_rs,"Reference_Number") & """>" & FP_FieldVal(fp_rs,"Reference_Number") & "</a>"%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="8697" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Date" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Date<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Date")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="3267" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Category" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Category<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Category")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="14744" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Inquirer_name" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Inquirer_name<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Inquirer_name")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="35795" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Inquirer_city" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Inquirer_city<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Inquirer_city")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="34489" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Inquirer_state" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Inquirer_state<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Inquirer_state")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="43378" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Topic" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Topic<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Topic")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="9523" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Reference_Number,Name,Division,Date,Category,Format,Inquirer_name,Inquirer_phone,Inquirer_address,Inquirer_city,Inquirer_state,Inquirer_zip,Inquirer_email,Topic,Response,Topic_other,Response_other" s-column="Response" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>Response<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"Response")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="15637" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="65064" --></tbody>
</table>
<p align="center"> </p>
</body>
</html>
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 6/30/2005 11:27:43
When I try to edit it, FrontPage won't allow me. It gives me this error: The contents of a FrontPage component have been modified. These contents will be overwritten when you save this page. However when I click save it doesn't save the changes. Can you show me in my code where it should go so I can make sure I'm putting it in the right place? Thanks.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Hyperlinks within the DRW - 6/30/2005 11:53:56
You'll need to put the DRW on a "Spooky Diet". Make a backup first then try the directions here: http://www.outfront.net/spooky/adv_drw_diet.htm You should be able to edit the code after that. Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 6/30/2005 16:24:38
That worked like a charm. Thanks Mr. D. You guys are really great. All the help is really appreciated. I don't know what I'd do without you guys! Thanks again!
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 6/30/2005 17:30:48
Ok so the form works almost the way I want it to. There is one thing left that I want to do. On the submit form there are drop down boxes that submit information. I would like the edit form to display the choice that is in the record in the db. As it is now, it doesn't display the correct choice. For example, in the db there is a record that shows the Name as John Smith. However, when the edit form is pulled up, it shows the first person on that drop down list. How can I get it to show the choice that is in the db? So in this example when I go to the edit page for this record I would like that drop down list to show John Smith and not Jane Doe. Am I making sense to anyone out there? Please let me know. I'll post the submit form and the edit form so you can see what I did. submit form
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("Public_Inquiry_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "Inquiry", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(16)
Dim arFormDBFields0(16)
Dim arFormValues0(16)
arFormFields0(0) = "scaddr"
arFormDBFields0(0) = "Inquirer_address"
arFormValues0(0) = Request("scaddr")
arFormFields0(1) = "scinqname"
arFormDBFields0(1) = "Inquirer_name"
arFormValues0(1) = Request("scinqname")
arFormFields0(2) = "screspother"
arFormDBFields0(2) = "Response_other"
arFormValues0(2) = Request("screspother")
arFormFields0(3) = "scemail"
arFormDBFields0(3) = "Inquirer_email"
arFormValues0(3) = Request("scemail")
arFormFields0(4) = "scphone"
arFormDBFields0(4) = "Inquirer_phone"
arFormValues0(4) = Request("scphone")
arFormFields0(5) = "scresponse"
arFormDBFields0(5) = "Response"
arFormValues0(5) = Request("scresponse")
arFormFields0(6) = "sctopic"
arFormDBFields0(6) = "Topic"
arFormValues0(6) = Request("sctopic")
arFormFields0(7) = "sczip"
arFormDBFields0(7) = "Inquirer_zip"
arFormValues0(7) = Request("sczip")
arFormFields0(8) = "scformat"
arFormDBFields0(8) = "Format"
arFormValues0(8) = Request("scformat")
arFormFields0(9) = "sctopother"
arFormDBFields0(9) = "Topic_other"
arFormValues0(9) = Request("sctopother")
arFormFields0(10) = "scdiv"
arFormDBFields0(10) = "Division"
arFormValues0(10) = Request("scdiv")
arFormFields0(11) = "scstate"
arFormDBFields0(11) = "Inquirer_state"
arFormValues0(11) = Request("scstate")
arFormFields0(12) = "sccity"
arFormDBFields0(12) = "Inquirer_city"
arFormValues0(12) = Request("sccity")
arFormFields0(13) = "sccatgry"
arFormDBFields0(13) = "Category"
arFormValues0(13) = Request("sccatgry")
arFormFields0(14) = "scname"
arFormDBFields0(14) = "Name"
arFormValues0(14) = Request("scname")
arFormFields0(15) = "scdate"
arFormDBFields0(15) = "Date"
arFormValues0(15) = Request("scdate")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"PublicInquiriesForm.asp",_
"Return to the form."
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<head>
<title>Public Inquiries Query</title>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:Approval_x0020_Level msdt:dt="string"></mso:Approval_x0020_Level>
<mso:Categories msdt:dt="string">Business</mso:Categories>
<mso:Assigned_x0020_To msdt:dt="string"></mso:Assigned_x0020_To>
</mso:CustomDocumentProperties>
</xml><![endif]-->
<meta name="Microsoft Border" content="none, default">
</head>
<%
Dim con
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Const adOpenKeyset = 0
Const adLockOptimistic = 1
'Create the objects
Set con = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
' Open the connection to the Employee In or Out Database
con.Open "PubInq", "sqlquery", "querysql"
strParm1 =("scdate")
strParm2 =("scname")
strParm3 =("scdiv")
strParm4 =("sccatgry")
strParm5 =("scformat")
strParm6 =("scinqname")
strParm7 =("scphone")
strParm8 =("sccatgry")
strParm9 =("scaddr")
strParm10 =("sccity")
strParm11 =("scstate")
strParm12 =("sczip")
strParm13 =("scemail")
strParm3 =("sctopic")
strParm1 =("scresponse")
strParm2 =("sctopother")
strParm2 =("screspother")
' Create the SQL Query String
' Employee Query String
strSQL = " select Name " & _
" from Employees " & _
" Order by Name "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
<p align="center"><strong><font size="5">Public Inquiries Entry Form</font></strong></p>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" suggestedext="asp" s-dataconnection="Public_Inquiry" s-recordsource="Inquiry" s-form-fields="scaddr scinqname screspother scemail scphone scresponse sctopic sczip scformat sctopother scdiv scstate sccity sccatgry scname scdate" s-form-dbfields="Inquirer_address Inquirer_name Response_other Inquirer_email Inquirer_phone Response Topic Inquirer_zip Format Topic_other Division Inquirer_state Inquirer_city Category Name Date" u-asp-include-url="../../_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="43152" --><p align="left">
<u><b>Date Received</b> </u><p align="left">
<input type="text" name="scdate" size="20"> (YYYYMMDD)<p align="left">
<u><b>Staff Name & Division Receiving Inquiry</b></u></p>
<p align="left">
<select size="1" name="scname">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Name")%>"><%=rst("Name")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Division " & _
" from Division " & _
" Order by Division "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select> <b>Name</b>
<select size="1" name="scdiv">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Division")%>"><%=rst("Division")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquirer_Category " & _
" from Inquirer_Category " & _
" Order by Inquirer_Category "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select>
<b>Division</b> </p>
<p align="left">
<b><u>Inquirer Category</u> <u>Inquiry Format</u></b></p>
<p align="left">
<select size="1" name="sccatgry">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Inquirer_Category")%>"><%=rst("Inquirer_Category")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquiry_Format " & _
" from Inquiry_Format " & _
" Order by Inquiry_Format "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select>
<select size="1" name="scformat">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Inquiry_Format")%>"><%=rst("Inquiry_Format")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Topic " & _
" from Topic " & _
" Order by Topic "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select><b></b></p>
<p align="left">
<u><b>Name of Inquirer</b></u></p>
<p align="left">
<input type="text" name="scinqname" size="20"></p>
<p align="left">
<u>
<b>Inquirer Contact Information</b></u></p>
<p align="left"><input type="text" name="scphone" size="20">
<b>Telephone Number </b> (No dashes/parentheses)</p>
<p align="left"><input type="text" name="scaddr" size="20">
<b> Mailing Address </b></p>
<p align="left"><input type="text" name="sccity" size="20">
<b>City</b></p>
<p align="left"><input type="text" name="scstate" size="20">
<b>State</b></p>
<p align="left"><input type="text" name="sczip" size="20">
<b> Zip</b></p>
<p align="left"><input type="text" name="scemail" size="20">
<b> Email Address</b></p>
<p align="left">
<b><u>Description/Topic of Inquiry</u> </b> <b><u>Description of Response or Referral</u></b> </p>
<p align="left">
<select size="1" name="sctopic">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Topic")%>"><%=rst("Topic")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Response " & _
" from Response " & _
" Order by Response "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select>
<select size="1" name="scresponse">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Response")%>"><%=rst("Response")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%></select> </p>
<p align="left">
<input type="text" name="sctopother" size="20"> <b>Other</b>
<input type="text" name="screspother" size="20"> <b>Other </b> </p>
<p align="left">
</p>
<blockquote>
<blockquote>
<p align="left">
<input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
<p align="left">
<font size="4"> <a href="PublicInquiriesRecords.asp">Click
here if you would like to edit an existing entry.</a></font></p>
</blockquote>
</blockquote>
<p align="left">
</p>
</select>
</form>
</body></html>
<%
con.Close
%>
edit form
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Public Inquiries Query </title>
</head>
<body>
<div align="center">
<center>
<table width="600" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
</table>
</center>
</div>
<form BOTID="0" METHOD="POST" ACTION="PublicInquiriesEdit.asp">
<p align="center"><b><font size="5">Public Inquiries Edit</font></b></p>
</form>
<!--#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 Inquiry WHERE (Reference_Number = ::Reference_Number::)"
fp_sDefault="Reference_Number=0"
fp_sNoRecords=""
fp_sDataConn="Public_Inquiry"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="Name"
fp_sMenuValue="Name"
fp_iDisplayCols=17
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<%
Dim con
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Const adOpenKeyset = 0
Const adLockOptimistic = 1
'Create the objects
Set con = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
' Open the connection to the Employee In or Out Database
con.Open "PubInq", "sqlquery", "querysql"
strSQL = " select Name " & _
" from Employees " & _
" Order by Name "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
<form METHOD="POST" action="PublicInquiriesUpdate.asp">
<p>
</p>
<p><font size="4">
<font color="#0000FF">Edit the entry </font></font></p>
<table BORDER="0">
</tr>
<tr>
<td><b>Name:</b></td>
<td>
<select size="1" name="D1"><%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Name")%>"><%=rst("Name")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Division " & _
" from Division " & _
" Order by Division "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Division:</b></td>
<td>
<select size="1" name="D2">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Division")%>"><%=rst("Division")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquirer_Category " & _
" from Inquirer_Category " & _
" Order by Inquirer_Category "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Date:</b></td>
<td>
<input TYPE="TEXT" NAME="Date" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Date")%>"></td>
</tr>
<tr>
<td><b>Category:</b></td>
<td>
<select size="1" name="D3">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Inquirer_Category")%>"><%=rst("Inquirer_Category")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquiry_Format " & _
" from Inquiry_Format " & _
" Order by Inquiry_Format "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Format:</b></td>
<td>
<select size="1" name="D4">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Inquiry_Format")%>"><%=rst("Inquiry_Format")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Topic " & _
" from Topic " & _
" Order by Topic "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Inquirer_name:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_name" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_name")%>"></td>
</tr>
<tr>
<td><b>Inquirer_phone:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_phone" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_phone")%>"></td>
</tr>
<tr>
<td><b>Inquirer_address:</b></td>
<td>
<input NAME="Inquirer_address" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_address")%>"></td>
</tr>
<tr>
<td><b>Inquirer_city:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_city" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_city")%>"></td>
</tr>
<tr>
<td><b>Inquirer_state:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_state" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_state")%>"></td>
</tr>
<tr>
<td><b>Inquirer_zip:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_zip" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_zip")%>"></td>
</tr>
<tr>
<td><b>Inquirer_email:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_email" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_email")%>"></td>
</tr>
<tr>
<td><b>Topic:</b></td>
<td>
<select size="1" name="D5">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Topic")%>"><%=rst("Topic")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Response " & _
" from Response " & _
" Order by Response "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Response:</b></td>
<td>
<select size="1" name="D6">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("Response")%>"><%=rst("Response")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%></select></td>
</tr>
<tr>
<td><b>Topic_other:</b></td>
<td>
<input TYPE="TEXT" NAME="Topic_other" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Topic_other")%>"></td>
</tr>
<tr>
<td><b>Response_other:</b></td>
<td>
<input TYPE="TEXT" NAME="Response_other" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Response_other")%>"></td>
</tr>
<tr>
<td><b></b></td>
<td>
<a href="<%=FP_FieldLink(fp_rs,"Reference_Number")%>">
<input type="hidden" NAME="Reference_Number" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Reference_Number")%>"></a></td>
</tr>
<tr>
<td COLSPAN="2"><br>
<a href="PublicInquiriesUpdate.asp">
<input TYPE="Submit" NAME="fp_submit"></a><input TYPE="Reset" NAME="fp_reset"></td>
</tr>
</table>
</form>
<hr>
<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</body></html>
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 9:01:11
I think you can fix it here: <option value="<%=rst("Name")%>"><%=rst("Name")%></option> Make this line look like: <option value="<%=rst("Name")%>"<%IF FP_Field(fp_rs,"theNameField") = rst("Name") THEN Response.write(" selected") END IF %>><%=rst("Name")%></option> and change "theNameField" to match whatever the field holding the name is titled. (It may not be the same one you're building the dropdown with.) That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 10:57:26
I tried your code and it still didn't work. Here is what I have after the change.
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Public Inquiries Query </title>
</head>
<body>
<div align="center">
<center>
<table width="600" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
</table>
</center>
</div>
<form BOTID="0" METHOD="POST" ACTION="PublicInquiriesEdit.asp">
<p align="center"><b><font size="5">Public Inquiries Edit</font></b></p>
</form>
<!--#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 Inquiry WHERE (Reference_Number = ::Reference_Number::)"
fp_sDefault="Reference_Number=0"
fp_sNoRecords=""
fp_sDataConn="Public_Inquiry"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="Name"
fp_sMenuValue="Name"
fp_iDisplayCols=17
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<%
Dim con
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Const adOpenKeyset = 0
Const adLockOptimistic = 1
'Create the objects
Set con = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
' Open the connection to the Employee In or Out Database
con.Open "PubInq", "sqlquery", "querysql"
strSQL = " select Name " & _
" from Employees " & _
" Order by Name "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
<form METHOD="POST" action="PublicInquiriesUpdate.asp">
<p>
</p>
<p><font size="4">
<font color="#0000FF">Edit the entry </font></font></p>
<table BORDER="0">
</tr>
<tr>
<td><b>Name:</b></td>
<td>
<select size="1" name="Name">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%>
<option value="<%=rst("Name")%>"<%IF FP_Field(fp_rs,"Name") = rst("Name") THEN Response.write("selected") END IF %>><%=rst("Name")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Division " & _
" from Division " & _
" Order by Division "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Division:</b></td>
<td>
<select size="1" name="Division">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=FP_FieldVal(fp_rs,"Division")%>"><%=FP_FieldVal(fp_rs,"Division")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquirer_Category " & _
" from Inquirer_Category " & _
" Order by Inquirer_Category "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Date:</b></td>
<td>
<input TYPE="TEXT" NAME="Date" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Date")%>"></td>
</tr>
<tr>
<td><b>Category:</b></td>
<td>
<select size="1" name="Category">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option <% If FP_FieldVal(fp_rs,"Format")= "In Person" Then response.write ("selected") End If %>>In Person </option>
<option <% If FP_FieldVal(fp_rs,"Format")= "Mail/Fax" Then response.write ("selected") End If %>>Mail/Fax </option>
<option <% If FP_FieldVal(fp_rs,"Format")= "NML Webmaster" Then response.write ("selected") End If %>>NML Webmaster </option>
<option <% If FP_FieldVal(fp_rs,"Format")= "Other" Then response.write ("selected") End If %>>Other </option>
<option <% If FP_FieldVal(fp_rs,"Format")= "Other email" Then response.write ("selected") End If %>>Other email </option>
<option <% If FP_FieldVal(fp_rs,"Format")= "Phone" Then response.write ("selected") End If %>>Phone </option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select InquiryFormat " & _
" from InquiryFormat " & _
" Order by InquiryFormat "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Format:</b></td>
<td>
<select size="1" name="Format">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=rst("InquiryFormat")%>"><%=rst("InquiryFormat")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Topic " & _
" from Topic " & _
" Order by Topic "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Inquirer_name:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_name" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_name")%>"></td>
</tr>
<tr>
<td><b>Inquirer_phone:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_phone" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_phone")%>"></td>
</tr>
<tr>
<td><b>Inquirer_address:</b></td>
<td>
<input NAME="Inquirer_address" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_address")%>"></td>
</tr>
<tr>
<td><b>Inquirer_city:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_city" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_city")%>"></td>
</tr>
<tr>
<td><b>Inquirer_state:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_state" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_state")%>"></td>
</tr>
<tr>
<td><b>Inquirer_zip:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_zip" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_zip")%>"></td>
</tr>
<tr>
<td><b>Inquirer_email:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_email" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_email")%>"></td>
</tr>
<tr>
<td><b>Topic:</b></td>
<td>
<select size="1" name="Topic">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=FP_FieldVal(fp_rs,"Topic")%>"><%=FP_FieldVal(fp_rs,"Topic")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Response " & _
" from Response " & _
" Order by Response "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Response:</b></td>
<td>
<select size="1" name="Response">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until ther are no more records
Do While Not rst.EOF
%> <option value="<%=FP_FieldVal(fp_rs,"Response")%>"><%=FP_FieldVal(fp_rs,"Response")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%></select></td>
</tr>
<tr>
<td><b>Topic_other:</b></td>
<td>
<input TYPE="TEXT" NAME="Topic_other" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Topic_other")%>"></td>
</tr>
<tr>
<td><b>Response_other:</b></td>
<td>
<input TYPE="TEXT" NAME="Response_other" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Response_other")%>"></td>
</tr>
<tr>
<td><b></b></td>
<td>
<a href="<%=FP_FieldLink(fp_rs,"Reference_Number")%>">
<input type="hidden" NAME="Reference_Number" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Reference_Number")%>"></a></td>
</tr>
<tr>
<td COLSPAN="2"><br>
<a href="PublicInquiriesUpdate.asp">
<input TYPE="Submit" NAME="fp_submit"></a><input TYPE="Reset" NAME="fp_reset"></td>
</tr>
</table>
</form>
<hr>
<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</body></html>
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 11:25:00
A coupla' things before I dig too deep into your code: 1. That option line I posted is the dropdown in question, correct? 2. What is the field name of the name field in the *returned* recordset? 3. What *exactly* is returned for question 2? See, what the basics are is you need to match the returned field to the names being listed in the dropdown. If they match, put the word " selected" in the option tag. If they don't match, you'll never get the dropdown to select programmatically. Sometimes people put the user id in the related table instead of the name. If so, you'd want to put the userID in the *value* of the dropdown to get a match. Does that make sense?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 11:29:39
Yes that is one of the drop downs in question. Also the name of that field is Name. The table is Employees and the field is Name. There are about 62 names in that table. So do I need to do 62 option lines? If so I am bummed! I'm trying to find an easy way to do it, but I don't think there is one!
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 11:57:16
So all of that is from just 1 table? Then where does this line: fp_sQry="SELECT * FROM Inquiry WHERE (Reference_Number = ::Reference_Number::)" come into play? That is what we're comparing. The "name" field from the table "Inquiry" to the "name" field in the user table. So whatever the name field is in the Inquiry table is what should be used in: FP_Field(fp_rs,"theNameField") when I use the code: <option value="<%=rst("Name")%>"<%IF FP_Field(fp_rs,"theNameField") = rst("Name") THEN Response.write(" selected") END IF %>><%=rst("Name")%></option> See, rst("Name") is the user table *not* the inquiry table. FP_Field(fp_rs,"theNameField") is the Inquiry table and those two is what we should be comparing. Also make sure you have a space before selected in: Response.write(" selected") If that gives you no help, just do a Response.write(FP_Field(fp_rs,"theNameField")) and see if you're definitely getting what you expect from the Inquiry table. (Of curse use the proper field name here.) That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 12:09:50
Well the field name on both the Inquiry table and the user table is Name. Also I tried the response.write like you suggested and I got the same display.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 12:12:12
Sorry I didn't explain your first question. The Inquiry table is where all the results are from. The Employee(user table) is where all the employees are stored. There are actually several tables in this DB. However, the Inquiry table is where the form submits to. It holds all the results.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 13:17:30
quote:
Also I tried the response.write like you suggested and I got the same display. So when you did that, you got a name that should have matched someone in the dropdown? 2 things I'd like to try: 1. Try using the trim function like so: <option value="<%=trim(rst("Name"))%>"<%IF trim(FP_Field(fp_rs,"Name")) = trim(rst("Name")) THEN Response.write("selected") END IF %>><%=rst("Name")%></option> 2. Try to see if the values look *exactly* the same by using this code: <option value="<%=rst("Name")%>"<%IF FP_Field(fp_rs,"Name") = rst("Name") THEN Response.write("selected") END IF %>><%=rst("Name")&":"&FP_Field(fp_rs,"Name")%></option> That give any leads?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 13:33:25
Ok so that worked! You are an awesome dude! One problem however. When I try to use that for the drop down lists for the Inquirer_Category and Inquiry_Format I get a recordset error that says the item cannot be found in the requested name or ordinal. Is that maybe because of the underscore used in those? I will post the code. Thanks again!!!!
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Public Inquiries Query </title>
</head>
<body>
<div align="center">
<center>
<table width="600" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
</table>
</center>
</div>
<form BOTID="0" METHOD="POST" ACTION="PublicInquiriesEdit.asp">
<p align="center"><b><font size="5">Public Inquiries Edit</font></b></p>
</form>
<!--#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 Inquiry WHERE (Reference_Number = ::Reference_Number::)"
fp_sDefault="Reference_Number=0"
fp_sNoRecords=""
fp_sDataConn="Public_Inquiry"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="Name"
fp_sMenuValue="Name"
fp_iDisplayCols=17
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<%
Dim con
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Const adOpenKeyset = 0
Const adLockOptimistic = 1
'Create the objects
Set con = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
' Open the connection to the Employee In or Out Database
con.Open "PubInq", "sqlquery", "querysql"
strSQL = " select Name " & _
" from Employees " & _
" Order by Name "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
<form METHOD="POST" action="PublicInquiriesUpdate.asp">
<p>
</p>
<p><font size="4">
<font color="#0000FF">Edit the entry </font></font></p>
<table BORDER="0">
</tr>
<tr>
<td><b>Name:</b></td>
<td>
<select size="1" name="Name">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until there are no more records
Do While Not rst.EOF
%>
<option value="<%=trim(rst("Name"))%>"<%IF trim(FP_Field(fp_rs,"Name")) = trim(rst("Name")) THEN Response.write(" selected") END IF %>>
<%=rst("Name")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Division " & _
" from Division " & _
" Order by Division "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Division:</b></td>
<td>
<select size="1" name="Division">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until there are no more records
Do While Not rst.EOF
%> <option value="<%=trim(rst("Division"))%>"<%IF trim(FP_Field(fp_rs,"Division")) = trim(rst("Division")) THEN Response.write(" selected") END IF %>>
<%=rst("Division")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquirer_Category " & _
" from Inquirer_Category " & _
" Order by Inquirer_Category "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Date:</b></td>
<td>
<input TYPE="TEXT" NAME="Date" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Date")%>"></td>
</tr>
<tr>
<td><b>Category:</b></td>
<td>
<select size="1" name="Category">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until there are no more records
Do While Not rst.EOF
%>
<option value="<%=trim(rst("Inquirer_Category"))%>"<%IF trim(FP_Field(fp_rs,"Inquirer_Category")) = trim(rst("Inquirer_Category")) THEN Response.write(" selected") END IF %>>
<%=rst("Inquirer_Category")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Inquiry_Format " & _
" from Inquiry_Format " & _
" Order by Inquiry_Format "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Format:</b></td>
<td>
<select size="1" name="Format">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until there are no more records
Do While Not rst.EOF
%>
<option value="<%=trim(rst("Inquiry_Format"))%>"<%IF trim(FP_Field(fp_rs,"Inquiry_Format")) = trim(rst("Inquiry_Format")) THEN Response.write(" selected") END IF %>>
<%=rst("Inquiry_Format")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Topic " & _
" from Topic " & _
" Order by Topic "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Inquirer_name:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_name" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_name")%>"></td>
</tr>
<tr>
<td><b>Inquirer_phone:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_phone" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_phone")%>"></td>
</tr>
<tr>
<td><b>Inquirer_address:</b></td>
<td>
<input NAME="Inquirer_address" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_address")%>"></td>
</tr>
<tr>
<td><b>Inquirer_city:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_city" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_city")%>"></td>
</tr>
<tr>
<td><b>Inquirer_state:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_state" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_state")%>"></td>
</tr>
<tr>
<td><b>Inquirer_zip:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_zip" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_zip")%>"></td>
</tr>
<tr>
<td><b>Inquirer_email:</b></td>
<td>
<input TYPE="TEXT" NAME="Inquirer_email" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Inquirer_email")%>"></td>
</tr>
<tr>
<td><b>Topic:</b></td>
<td>
<select size="1" name="Topic">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until there are no more records
Do While Not rst.EOF
%> <option value="<%=trim(rst("Topic"))%>"<%IF trim(FP_Field(fp_rs,"Topic")) = trim(rst("Topic")) THEN Response.write(" selected") END IF %>>
<%=rst("Topic")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%>
<%
strSQL = " select Response " & _
" from Response " & _
" Order by Response "
Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
%>
</select></td>
</tr>
<tr>
<td><b>Response:</b></td>
<td>
<select size="1" name="Response">
<%
' Only display records if there are records in the recordset
If NOT rst.EOF then
'Loop through the recordset until there are no more records
Do While Not rst.EOF
%> <option value="<%=trim(rst("Response"))%>"<%IF trim(FP_Field(fp_rs,"Response")) = trim(rst("Response")) THEN Response.write(" selected") END IF %>>
<%=rst("Response")%></option>
<%
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop
Else
%> <option value="Error">No records Found</option>
<%
End If
rst.Close
%></select></td>
</tr>
<tr>
<td><b>Topic_other:</b></td>
<td>
<input TYPE="TEXT" NAME="Topic_other" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Topic_other")%>"></td>
</tr>
<tr>
<td><b>Response_other:</b></td>
<td>
<input TYPE="TEXT" NAME="Response_other" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Response_other")%>"></td>
</tr>
<tr>
<td><b></b></td>
<td>
<a href="<%=FP_FieldLink(fp_rs,"Reference_Number")%>">
<input type="hidden" NAME="Reference_Number" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Reference_Number")%>"></a></td>
</tr>
<tr>
<td COLSPAN="2"><br>
<a href="PublicInquiriesUpdate.asp">
<input TYPE="Submit" NAME="fp_submit"></a><input TYPE="Reset" NAME="fp_reset"></td>
</tr>
</table>
</form>
<hr>
<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</body></html>
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 13:48:08
quote:
When I try to use that for the drop down lists for the Inquirer_Category and Inquiry_Format I get a recordset error that says the item cannot be found in the requested name or ordinal. Can you be specific about this? Can you post the error and the code in question? (Sorry, got a lot goin' on today.) EDIT. Underscores should not affect any of this - they are valid characters everywhere that I'm aware of. That specific error frequently means a typo somewhere.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 13:53:21
Ok. I have to step out for a bit, but I'll post it as soon as I get back. I know you're busy answering other people's questions as well so I'll try my best to be clear. Thanks for your help with this. I really do appreciate it.
|
|
|
|
rrnml
Posts: 197 Joined: 9/20/2004 Status: offline
|
RE: Hyperlinks within the DRW - 7/1/2005 14:45:30
Hey there rdouglass. I just wanted to let you know that I figured out that recordset error. I had it pointing to the wrong place. Anyway wanted to say thanks so much for your help with this. I really appreciate your time with this. Thanks again.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|