This is a multi-part message in MIME format.

------=_NextPart_000_0035_01C6DB0A.167ACBA0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit

BlankI sent the post below to an Access newsgroup, but I think it may a
vbscript problem.

As a further test, I added this code to update_password.asp:
Response.write "update_form.asp?ID=" & Request.QueryString("ID")

update_password.asp was called by
<%="<a href=""update_password.asp?ID=" & FP_FieldVal(fp_rs,"ID") &
""">"%>Update</a>

update_password.asp was loaded, with the address bar:
http://trevorl.mvps.org/update_password.asp?ID=21

update_password.asp displayed:
update_form.asp?ID=

So I guess the query is why is Request.QueryString("ID") not returning a
value when the ID shows in the address bar

Any files needed can be extracted from http://trevorl.mvps.org/mvpweb.zip

---- Original Message ----
From: Trevor L.
Newsgroups: microsoft.private.mvp.access
Sent: Sunday, September 17, 2006 5:15 PM
Subject: Re: Passing parameter strings in ASP of ID for an Access DB

> I have several ASP files for reading and updating an Access database
>
> guestbook.asp which reads the entire database and has the line at the
> bottom
> <a href="update_password.asp">Update Comment on Guestbook</a><br />
>
> update_password.asp accepts the password and calls
> update_guestbook.asp
> update_guestbook.asp reads the entire database again and calls
> udpate_form.asp with ID= the value for the recordset
> update_form reads the database for the selected record and calls
> udpate_entry for that record
> udpate_entry does the actual update
>
> I would prefer that the datbase not be read so many times
> My idea is:
> guestbook.asp has an entry against each record
> <%="<a href=""update_password.asp?ID=" & FP_FieldVal(fp_rs,"ID") &
> """>Update</a>"%>
> so that when Update is clicked it calls update_password.asp which
> then passes the ID to udpate_form.asp and subsequently to
> udpate_entry.asp
>
> The ASP files are attached
> There are also some other .inc files but they appear to do the job
> they should (most are FrontPage generated)
>
> My problem is that I cannot sucessfully pass the parameter ID from
> guestbook.asp to update_password.asp to update_form.asp. I either get
> a missing ID (e.g. ?ID= rather than ID=21) and/or a syntax error
>
> I can pass it from guestbook.asp to update_password.asp but this uses
> FP_FieldVal(fp_rs,"ID")
>
> When I try to pass it from update_password to udpate_form using:
> Response.Redirect "update_form.asp?ID=" & Request.QueryString("ID")
> I get the message:
> Microsoft JET Database Engine error '80040e14'
> Syntax error (missing operator) in query expression 'ID='.
> /update_form.asp, line 34
> Line 34 is
> rsUpdateEntry.Open strSQL, adoCon
>
> I also tried this in update_form.asp:
> strSQL = "SELECT * FROM Results WHERE ID=" &
> Clng(Request.QueryString("ID"))
> I got the message:
> Microsoft VBScript runtime error '800a000d'
> Type mismatch: 'Clng'
> /update_form.asp, line 25
>
> CStr(Request.QueryString("ID")) does not work either
>
> The address line reads
> http://trevorl.mvps.org/update_form.asp?ID=
>
> What do I have to do ?

--
Thanks,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/


------=_NextPart_000_0035_01C6DB0A.167ACBA0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=3DridTitle>Blank</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<STYLE><!-- body { font-family: Arial, Helvetica; font-size: 10pt; =
color: #000000; margin-top: 25px; margin-left: 25px; } P.msoNormal, =
LI.msoNormal { font-family: Helvetica, "Times New Roman"; font-size: =
10pt; margin-top: 0px; margin-left: 0px; color: "#ffffcc"; } --></STYLE>

<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff background=3D"Blank Bkgrd.gif">
<DIV>
<DIV>I sent the post below to an Access newsgroup, but I think it may a =
vbscript=20
problem.</DIV>
<DIV>&nbsp;</DIV>
<DIV>As a further test,&nbsp;I added this code to update_password.asp:
<DIV>Response.write "update_form.asp?ID=3D" &amp; =
Request.QueryString("ID")</DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV>update_password.asp was called by</DIV>
<DIV>&lt;%=3D"&lt;a href=3D""update_password.asp?ID=3D" &amp; =
FP_FieldVal(fp_rs,"ID")=20
&amp; """&gt;"%&gt;Update&lt;/a&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>update_password.asp was loaded, with the address bar:
<DIV><A=20
href=3D"http://trevorl.mvps.org/update_password.asp?ID=3D21">http://trevo=
rl.mvps.org/update_password.asp?ID=3D21</A></DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>update_password.asp displayed:</DIV>
<DIV>update_form.asp?ID=3D</DIV>
<DIV>&nbsp;</DIV>
<DIV>So I guess the query is why is Request.QueryString("ID") not =
returning a=20
value when the ID shows in the address bar</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any files needed can be extracted from <A class=3D0=20
href=3D"http://trevorl.mvps.org/mvpweb.zip"><FONT=20
color=3D#000000>http://trevorl.mvps.org/mvpweb.zip</FONT></A><BR></DIV>
<DIV>---- Original Message ----<BR>From: Trevor L.<BR>Newsgroups:=20
microsoft.private.mvp.access<BR>Sent: Sunday, September 17, 2006 5:15=20
PM<BR>Subject: Re: Passing parameter strings in ASP of ID for an Access=20
DB<BR><BR>&gt; I have several ASP files for reading and updating an =
Access=20
database<BR>&gt; <BR>&gt; guestbook.asp which reads the entire database =
and has=20
the line at the<BR>&gt; bottom <BR>&gt; &lt;a=20
href=3D"update_password.asp"&gt;Update Comment on =
Guestbook&lt;/a&gt;&lt;br=20
/&gt;<BR>&gt; <BR>&gt; update_password.asp accepts the password and=20
calls<BR>&gt; update_guestbook.asp <BR>&gt; update_guestbook.asp reads =
the=20
entire database again and calls<BR>&gt; udpate_form.asp with ID=3D the =
value for=20
the recordset <BR>&gt; update_form reads the database for the selected =
record=20
and calls<BR>&gt; udpate_entry for that record <BR>&gt; udpate_entry =
does the=20
actual update<BR>&gt; <BR>&gt; I would prefer that the datbase not be =
read so=20
many times<BR>&gt; My idea is:<BR>&gt;&nbsp; guestbook.asp has an entry =
against=20
each record<BR>&gt; &lt;%=3D"&lt;a href=3D""update_password.asp?ID=3D" =
&amp;=20
FP_FieldVal(fp_rs,"ID") &amp;<BR>&gt; """&gt;Update&lt;/a&gt;"%&gt; =
<BR>&gt; so=20
that when Update is clicked it calls update_password.asp which<BR>&gt; =
then=20
passes the ID to udpate_form.asp and subsequently to<BR>&gt;=20
udpate_entry.asp&nbsp; <BR>&gt; <BR>&gt; The ASP files are =
attached<BR>&gt;=20
There are also some other .inc files but they appear to do the =
job<BR>&gt; they=20
should (most are FrontPage generated) <BR>&gt; <BR>&gt; My problem is =
that I=20
cannot sucessfully pass the parameter ID from<BR>&gt; guestbook.asp to=20
update_password.asp to update_form.asp. I either get<BR>&gt; a missing =
ID (e.g.=20
?ID=3D rather than ID=3D21) and/or a syntax error&nbsp; <BR>&gt; =
<BR>&gt; I can pass=20
it from guestbook.asp to update_password.asp but this uses<BR>&gt;=20
FP_FieldVal(fp_rs,"ID") <BR>&gt; <BR>&gt; When I try to pass it from=20
update_password to udpate_form using:<BR>&gt; Response.Redirect=20
"update_form.asp?ID=3D" &amp; Request.QueryString("ID")<BR>&gt; I get =
the=20
message:<BR>&gt; Microsoft JET Database Engine error '80040e14'<BR>&gt; =
Syntax=20
error (missing operator) in query expression 'ID=3D'.<BR>&gt; =
/update_form.asp,=20
line 34<BR>&gt; Line 34 is<BR>&gt; rsUpdateEntry.Open strSQL, =
adoCon<BR>&gt;=20
<BR>&gt; I also tried this in update_form.asp:<BR>&gt; strSQL =3D =
"SELECT * FROM=20
Results WHERE ID=3D" &amp;<BR>&gt; Clng(Request.QueryString("ID")) =
<BR>&gt; I got=20
the message:<BR>&gt; Microsoft VBScript runtime error '800a000d'<BR>&gt; =
Type=20
mismatch: 'Clng'<BR>&gt; /update_form.asp, line 25<BR>&gt; <BR>&gt;=20
CStr(Request.QueryString("ID")) does not work either<BR>&gt; <BR>&gt; =
The=20
address line reads<BR>&gt; <A=20
href=3D"http://trevorl.mvps.org/update_form.asp?ID">http://trevorl.mvps.o=
rg/update_form.asp?ID</A>=3D<BR>&gt;=20
<BR>&gt; What do I have to do ?<BR><BR>-- <BR>Thanks,<BR>Trevor L.<BR>[=20
Microsoft MVP - FrontPage ]<BR>MVPS Website: <A=20
href=3D"http://trevorl.mvps.org/">http://trevorl.mvps.org/</A></DIV></DIV=
>
<P>&nbsp;</P></BODY></HTML>

------=_NextPart_000_0035_01C6DB0A.167ACBA0--

Re: Passing parameters via ASP/Vscript by Trevor

Trevor
Mon Sep 18 00:24:01 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_02F7_01C6DB36.77C872A0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit

BlankTrevor L. wrote:
> I sent the post below to an Access newsgroup, but I think it may a
> vbscript problem.
[etc, etc]

I am getting so frustrated with this problem

I added this code to see whether I could determine what type the QueryString
is and then maybe use a function to convert it so that it is recognised
<%document.write(TypeName(QueryString("ID")) & "<br />")%>

And I got
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'QueryString'
/update_password.asp, line 15

LIne 15 is, of course:
<%document.write(TypeName(QueryString("ID")) & "<br />")%>

BTW, the address bar reads
http://trevorl.mvps.org/update_password.asp?ID=21 , so ID must be known.

It should be so simple to extract the value of the query string and yet I
can't do it.

I have used JavaScript to extract the value of a passed variable quite
successfully, but why change horses in midstream - can't VBScript do it ??
(In any case if I use JS then I assume that I will have to continue to use
it because I doubt very much that JS variables would be available to
VBScript.)

--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/

------=_NextPart_000_02F7_01C6DB36.77C872A0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=3DridTitle>Blank</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<STYLE>BODY {
MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 25px; COLOR: #000000; =
FONT-FAMILY: Arial, Helvetica
}
P.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
LI.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
</STYLE>

<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff background=3D"Blank Bkgrd.gif">
<DIV>Trevor L. wrote:<BR>&gt; I sent the post below to an Access =
newsgroup, but=20
I think it may a<BR>&gt; vbscript problem. <BR>[etc, etc]</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am getting so frustrated with this problem</DIV>
<DIV>&nbsp;</DIV>
<DIV>I added this code to see whether I could determine what type the=20
QueryString is and then maybe use a function to convert it so that it is =

recognised</DIV>
<DIV>&lt;%document.write(TypeName(QueryString("ID")) &amp; "&lt;br=20
/&gt;")%&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>And I got<BR>Microsoft VBScript runtime <FONT face=3DArial =
size=3D2>error=20
'800a000d'</FONT><FONT face=3D"Times New Roman" size=3D3> =
<BR></FONT><FONT=20
face=3DArial size=3D2>Type mismatch: 'QueryString'</FONT> <BR><FONT =
face=3DArial=20
size=3D2>/update_password.asp</FONT><FONT face=3DArial size=3D2>, line =
15</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>LIne 15 is, of course:&nbsp;</DIV>
<DIV>&lt;%document.write(TypeName(QueryString("ID")) &amp; "&lt;br=20
/&gt;")%&gt;&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>BTW, the address bar reads</DIV>
<DIV><A=20
href=3D"http://trevorl.mvps.org/update_password.asp?ID=3D21">http://trevo=
rl.mvps.org/update_password.asp?ID=3D21</A>&nbsp;,=20
so&nbsp;ID must be known.</DIV>
<DIV>&nbsp;</DIV>
<DIV>It should be so simple to extract the value of the query string and =
yet I=20
can't do it.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have used JavaScript to extract the value of a passed variable =
quite=20
successfully, but why&nbsp;change horses in midstream - can't VBScript =
do it=20
??&nbsp;</DIV>
<DIV>(In any case if I use JS then I assume that I will have to continue =
to use=20
it because I doubt very much that JS variables would be available to=20
VBScript.)</DIV>
<DIV><BR>-- <BR>Cheers,<BR>Trevor L.<BR>[ Microsoft MVP - FrontPage =
]<BR>MVPS=20
Website: http://trevorl.mvps.org/</DIV></BODY></HTML>

------=_NextPart_000_02F7_01C6DB36.77C872A0--


Re: Passing parameters via ASP/Vscript by Trevor

Trevor
Mon Sep 18 01:22:18 CDT 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0412_01C6DB3E.9C9762A0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit

BlankTrevor L. wrote:
> Trevor L. wrote:
>> I sent the post below to an Access newsgroup, but I think it may a
>> vbscript problem.
> [etc, etc]
>
> I am getting so frustrated with this problem

Curiouser and curiouser, as Alice said

I may be having this conversation with myself, but it may get rid of a bit
of frustration

However, I tried this code:
<% iRecordId = Request.QueryString("id")
Response.write iRecordId%>

<%If Request.Form("strPass") = "***********" Then
' The correct password appears on the line above
Response.write "update_form.asp?ID=" & iRecordId
%>
<%Else%>
<form method="POST" action="update_password.asp">
<div class="subheading">Enter password to go to update page
<% If strPass <> "" Then %>
<p>
Incorrect Password<br />
Please Try again
</p>
<% End If %>
</div>
<p>
<input type="password" name="strPass" value="" size="20" class="inbox">
<input type="submit" value="Enter" class="button">
</p>
</form>
<% End If %>

The result was
Before entering the password:
21
Enter password to go to update page


After entering the password:
update_form.asp?ID=

So, on entering the file, ID is known, but after entering the password and
pressing Submit, it is not

I even tried changing the form tag to:
<form method="POST" action="update_password.asp?ID=" +
"<%=Request.QueryString("ID")%>">
(on the assumption that when the page is called from Submit, it needs the ID
parameter)
but it made no difference

l also tried changing the Response.write to:
Response.write "update_form.asp?ID=" & Request.QueryString("ID")
Again, no difference

I am missing something obvious, but what ??
(It isn't obvious at the moment !!)
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/

------=_NextPart_000_0412_01C6DB3E.9C9762A0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=3DridTitle>Blank</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<STYLE>BODY {
MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 25px; COLOR: #000000; =
FONT-FAMILY: Arial, Helvetica
}
P.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
LI.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
</STYLE>

<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff background=3D"Blank Bkgrd.gif">
<DIV>Trevor L. wrote:<BR>&gt; Trevor L. wrote:<BR>&gt;&gt; I sent the =
post below=20
to an Access newsgroup, but I think it may a<BR>&gt;&gt; vbscript=20
problem.<BR>&gt; [etc, etc]<BR>&gt; <BR>&gt; I am getting so frustrated =
with=20
this problem<BR></DIV>
<DIV>Curiouser and curiouser, as Alice said</DIV>
<DIV>&nbsp;</DIV>
<DIV>I may be having this conversation with myself, but it may get rid =
of a bit=20
of frustration&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>However, I tried this code:</DIV>
<DIV>&lt;%&nbsp;&nbsp;iRecordId =3D=20
Request.QueryString("id")<BR>&nbsp;&nbsp;Response.write =
iRecordId%&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;%If Request.Form("strPass") =3D "***********" Then<BR>' The =
correct=20
password appears on the line above</DIV>
<DIV>Response.write "update_form.asp?ID=3D" &amp;=20
iRecordId<BR>%&gt;<BR>&lt;%Else%&gt;<BR>&nbsp; &lt;form method=3D"POST"=20
action=3D"update_password.asp"&gt;<BR>&nbsp;&lt;div =
class=3D"subheading"&gt;Enter=20
password to go to update page<BR>&nbsp;&lt;% If strPass &lt;&gt; "" Then =

%&gt;<BR>&nbsp;&lt;p&gt;<BR>&nbsp;Incorrect Password&lt;br =
/&gt;<BR>&nbsp;Please=20
Try again<BR>&nbsp;&lt;/p&gt;<BR>&nbsp;&lt;% End If=20
%&gt;<BR>&nbsp;&lt;/div&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;p&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;input type=3D"password" =
name=3D"strPass"=20
value=3D"" size=3D"20" class=3D"inbox"&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;input=20
type=3D"submit" value=3D"Enter" =
class=3D"button"&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;/p&gt;<BR>&nbsp; &lt;/form&gt;<BR>&lt;% End If %&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>The result was </DIV>
<DIV>Before entering the password:</DIV>
<DIV>
<DIV align=3Dcenter>21=20
<FORM action=3Dupdate_password.asp method=3Dpost>
<DIV class=3Dsubheading>Enter password to go to update page </DIV>
<P><INPUT class=3Dinbox type=3Dpassword name=3DstrPass> <INPUT =
class=3Dbutton type=3Dsubmit value=3DEnter> </P></FORM></DIV></DIV>
<DIV>After entering the password:</DIV>
<DIV>
<DIV align=3Dcenter>update_form.asp?ID=3D <BR></DIV>
<DIV>So, on entering the file, ID is known, but after entering the =
password and=20
pressing Submit, it is not </DIV>
<DIV>&nbsp;</DIV>
<DIV>I even tried changing the form tag to:</DIV>
<DIV>&lt;form method=3D"POST" action=3D"update_password.asp?ID=3D" +=20
"&lt;%=3DRequest.QueryString("ID")%&gt;"&gt;</DIV>
<DIV>(on the assumption that when the page is called from Submit, it =
needs the=20
ID parameter)</DIV>
<DIV>but it made no difference&nbsp;<BR></DIV></DIV>
<DIV>l also tried changing the Response.write to: </DIV>
<DIV>Response.write "update_form.asp?ID=3D" &amp; =
Request.QueryString("ID")</DIV>
<DIV>Again, no difference</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am missing something obvious, but what ??</DIV>
<DIV>(It isn't obvious at the moment !!)</DIV>
<DIV>-- <BR>Cheers,<BR>Trevor L.<BR>[ Microsoft MVP - FrontPage =
]<BR>MVPS=20
Website: <A =
href=3D"http://trevorl.mvps.org/">http://trevorl.mvps.org/</A></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0412_01C6DB3E.9C9762A0--


Re: Passing parameters via ASP/Vscript by Bill

Bill
Mon Sep 18 09:32:37 CDT 2006

The query string value doesn't persist if you are re-submitting the =
form. You are on the right path by adding the query string to the Post =
action, but I'm having a little trouble trying to follow all the pieces =
of information you have posted so can't tell for sure what is going =
wrong. Creating a variable from the query string value was good =
troubleshooting, but use that outside of the If statement so you are =
looking at the same output both before and after the form submit. Also, =
look at the page source HTML at both stages to make sure you aren't =
passing a space, line feed or other unexpected character which might be =
breaking your query string.

--=20

Bill James
Microsoft MVP - Shell/User

Windows VBScript Utilities =BB www.billsway.com/vbspage/
Windows Tweaks & Tips =BB www.billsway.com/notes_public/

"Trevor L." <Trevor_L.@Canberra> wrote in message =
news:eZX3Iru2GHA.3656@TK2MSFTNGP04.phx.gbl...
> BlankTrevor L. wrote:
>> Trevor L. wrote:
>>> I sent the post below to an Access newsgroup, but I think it may a
>>> vbscript problem.
>> [etc, etc]
>>
>> I am getting so frustrated with this problem
>=20
> Curiouser and curiouser, as Alice said
>=20
> I may be having this conversation with myself, but it may get rid of a =
bit=20
> of frustration
>=20
> However, I tried this code:
> <% iRecordId =3D Request.QueryString("id")
> Response.write iRecordId%>
>=20
> <%If Request.Form("strPass") =3D "***********" Then
> ' The correct password appears on the line above
> Response.write "update_form.asp?ID=3D" & iRecordId
> %>
> <%Else%>
> <form method=3D"POST" action=3D"update_password.asp">
> <div class=3D"subheading">Enter password to go to update page
> <% If strPass <> "" Then %>
> <p>
> Incorrect Password<br />
> Please Try again
> </p>
> <% End If %>
> </div>
> <p>
> <input type=3D"password" name=3D"strPass" value=3D"" size=3D"20" =
class=3D"inbox">
> <input type=3D"submit" value=3D"Enter" class=3D"button">
> </p>
> </form>
> <% End If %>
>=20
> The result was
> Before entering the password:
> 21
> Enter password to go to update page
>=20
>=20
> After entering the password:
> update_form.asp?ID=3D
>=20
> So, on entering the file, ID is known, but after entering the password =
and=20
> pressing Submit, it is not
>=20
> I even tried changing the form tag to:
> <form method=3D"POST" action=3D"update_password.asp?ID=3D" +=20
> "<%=3DRequest.QueryString("ID")%>">
> (on the assumption that when the page is called from Submit, it needs =
the ID=20
> parameter)
> but it made no difference
>=20
> l also tried changing the Response.write to:
> Response.write "update_form.asp?ID=3D" & Request.QueryString("ID")
> Again, no difference
>=20
> I am missing something obvious, but what ??
> (It isn't obvious at the moment !!)
> --=20
> Cheers,
> Trevor L.
> [ Microsoft MVP - FrontPage ]
> MVPS Website: http://trevorl.mvps.org/
>

Re: Passing parameters via ASP/Vscript by Trevor

Trevor
Tue Sep 19 00:33:20 CDT 2006

Bill James wrote:
> The query string value doesn't persist if you are re-submitting the
> form.

Thanks for that

> You are on the right path by adding the query string to the
> Post action

Yep, that is why I tried it :-))

>, but I'm having a little trouble trying to follow all the
> pieces of information you have posted so can't tell for sure what is
> going wrong.

I thought that following the code would be difficult and of course it was
for me. :-))

> Creating a variable from the query string value was
> good troubleshooting,

Thanks

> but use that outside of the If statement so you
> are looking at the same output both before and after the form submit.
> Also, look at the page source HTML at both stages to make sure you
> aren't passing a space, line feed or other unexpected character which
> might be breaking your query string.

I have tried lots of trouble shooting since posting. So much that I can't
recall whether your suggestion was one of them or not. I appreciate getting
further ideas and I will use them if I run into further problems. (Actually
every time I make one small chnage, it seems to break something !!)

After trying for what seemed like for ever, I decided to Google for "ASP
password protected pages" and found
http://www.kuam.com/techtalk/passwordprotection.htm

This seemed to give a reasonable answer, but I still spent several hours
getting it right.

I had problems getting the parameters to pass between one ASP file and
another (but that was my problem from the beginning)

Hopefully, I have now got it right and foolproof

If you are at all interested, please try the guestbook on
http://trevorl.mvps.org/ and see if you can update or delete a record
without entering the password (which is also hopefuly well hidden)
--
Thanks again,
Trevor Lawrence
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/


Re: Passing parameters via ASP/Vscript by Me

Me
Wed Sep 20 09:04:06 CDT 2006

Hi Trevor,

I'm not sure what you're trying to do. I've got all the files and there
seems to be a LOT of code for a simple password changing form.

Which page is the ID going from and which is it going to?

Angie




Re: Passing parameters via ASP/Vscript by Trevor

Trevor
Thu Sep 21 19:57:30 CDT 2006

Me here :) wrote:
> Hi Trevor,
>
> I'm not sure what you're trying to do. I've got all the files and
> there seems to be a LOT of code for a simple password changing form.
>
> Which page is the ID going from and which is it going to?
>
> Angie

Angie,
Thanks for the reply.

I have sorted it all out now.

I have a Update button in guestbook.asp which calls:
update_password.asp (with a specific id)
update_password.asp requests the password and calls:
update_form.asp with this password and id

update_form.asp checks the password and if it is OK calls:
update_entry.asp, which does the update for the given id

If the password is incorrect in update_form.asp, a retry button is displayed
which re-calls:
udpate_password.asp

This seems as simple as I can get it. Note that there is a requirement to
pass the id all the way through to update_entry.asp. If a password fails,
then the id needs to be passed back for a password retry.

I also wish to hide the id (and the password, of course) from the address
bar, so I use:
<form action ="..." method="post"> with input fields:
<input type="hidden" name="xxx" value="<%=Request("xxx")%>">

If you can devise a simpler way that meets these requirements, then I am all
ears (or actually all eyes).
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/


Re: Passing parameters via ASP/Vscript by Bill

Bill
Fri Sep 22 00:05:59 CDT 2006

Glad to here you have it working. =20

You may want to consider using session variables, that might simplify =
things a bit. In general session variables are discouraged, but for =
what appears to be a low volume page it's not such a bad thing as long =
as you remove them when finished.

Another option is to submit back to the same page, with a value that =
directs you to different code using an if statement. That is more of a =
preference option than anything else, but if you have a lot of web pages =
at the same directory level it can reduce the number of files you have =
to sort through.

--=20

Bill James
Microsoft MVP - Shell/User

Windows VBScript Utilities =BB www.billsway.com/vbspage/
Windows Tweaks & Tips =BB www.billsway.com/notes_public/

"Trevor L." <Trevor_L.@Canberra> wrote in message =
news:uKItMLe3GHA.1268@TK2MSFTNGP02.phx.gbl...
> Me here :) wrote:
>> Hi Trevor,
>>
>> I'm not sure what you're trying to do. I've got all the files and
>> there seems to be a LOT of code for a simple password changing form.
>>
>> Which page is the ID going from and which is it going to?
>>
>> Angie
>=20
> Angie,
> Thanks for the reply.
>=20
> I have sorted it all out now.
>=20
> I have a Update button in guestbook.asp which calls:
> update_password.asp (with a specific id)
> update_password.asp requests the password and calls:
> update_form.asp with this password and id
>=20
> update_form.asp checks the password and if it is OK calls:
> update_entry.asp, which does the update for the given id
>=20
> If the password is incorrect in update_form.asp, a retry button is =
displayed=20
> which re-calls:
> udpate_password.asp
>=20
> This seems as simple as I can get it. Note that there is a requirement =
to=20
> pass the id all the way through to update_entry.asp. If a password =
fails,=20
> then the id needs to be passed back for a password retry.
>=20
> I also wish to hide the id (and the password, of course) from the =
address=20
> bar, so I use:
> <form action =3D"..." method=3D"post"> with input fields:
> <input type=3D"hidden" name=3D"xxx" value=3D"<%=3DRequest("xxx")%>">
>=20
> If you can devise a simpler way that meets these requirements, then I =
am all=20
> ears (or actually all eyes).
> --=20
> Cheers,
> Trevor L.
> [ Microsoft MVP - FrontPage ]
> MVPS Website: http://trevorl.mvps.org/=20
>

Re: Passing parameters via ASP/Vscript by Trevor

Trevor
Mon Sep 25 01:20:57 CDT 2006

Me here :) wrote:
> Hi Trevor
>
> I've attached files I would use.
>
> Minimal script, thus fast and efficient.
>
> Checks page refered from so no one can use outside apps to bombard it.
>
> Not sure where the entries are currently stored but this is written
> to use a Access DB.
>
> You can hide the database by changing the extension to asp despite it
> being an mdb file as the script will still access it.
>
> Don't worry if you don't want to use it. Just for your info.
>
> Angie (MS ASP MVP - 2002 & 2003)
>
> "Trevor L." <Trevor_L.@Canberra> wrote in message
> news:uKItMLe3GHA.1268@TK2MSFTNGP02.phx.gbl...
>
>> If you can devise a simpler way that meets these requirements, then
>> I am all
>> ears (or actually all eyes).

Angie,

Sorry I have taken so long to reply. I was looking at other ideas and put
this aside for later.

I have now tried to open the file you attached.

It is an RAR file and the options that Windows presents to open it are all
3rd patry programs, which I have to purchase.

Can you resend as a ZIP file ?

P.S.,
Yes I am using an Access DB
--
Many thanks,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/