Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: HELP ME. Server.transfer question, not working with quite right.


Message #1 by saslaw@c... on Thu, 18 Jul 2002 23:48:21
Hi.
I am having some problems with a server.transfer.
I am starting on one page, 1.asp, this is a form where users enter new 
information and this information is submitted into an access database.
They then are redirected to another page, 2.asp. On 2.asp they enter their 
email address and this checks the database to ensure they are in there. On 
2.asp if they are validated, I do server.transfer to the appropriate page, 
3a.asp, 3b.asp or 3c.asp.

On any of the 3.asp they have the option of updating their information in 
the database. The problem is when I click on update, it takes me to 2.asp, 
and not the redirect of the update statement on 3.asp. And the information 
is never updated into the access database.

When I look at the source code, it shows the form action for 3.asp as 
2.asp.  

Any advice? 
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 19 Jul 2002 12:55:06 +1000
>> The error is on line 8
> How do you know? I didn't post any code
Exactly

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <saslaw@c...>
Subject: [access_asp] HELP ME. Server.transfer question, not working with
quite right.


: I am having some problems with a server.transfer.
: I am starting on one page, 1.asp, this is a form where users enter new
: information and this information is submitted into an access database.
: They then are redirected to another page, 2.asp. On 2.asp they enter their
: email address and this checks the database to ensure they are in there. On
: 2.asp if they are validated, I do server.transfer to the appropriate page,
: 3a.asp, 3b.asp or 3c.asp.
:
: On any of the 3.asp they have the option of updating their information in
: the database. The problem is when I click on update, it takes me to 2.asp,
: and not the redirect of the update statement on 3.asp. And the information
: is never updated into the access database.
:
: When I look at the source code, it shows the form action for 3.asp as
: 2.asp.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #3 by saslaw@c... on Tue, 23 Jul 2002 00:07:29
I think you responded to the wrong question here.

Al


> >> The error is on line 8
> How do you know? I didn't post any code
Exactly

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <saslaw@c...>
Subject: [access_asp] HELP ME. Server.transfer question, not working with
quite right.


: I am having some problems with a server.transfer.
: I am starting on one page, 1.asp, this is a form where users enter new
: information and this information is submitted into an access database.
: They then are redirected to another page, 2.asp. On 2.asp they enter 
their
: email address and this checks the database to ensure they are in there. 
On
: 2.asp if they are validated, I do server.transfer to the appropriate 
page,
: 3a.asp, 3b.asp or 3c.asp.
:
: On any of the 3.asp they have the option of updating their information in
: the database. The problem is when I click on update, it takes me to 
2.asp,
: and not the redirect of the update statement on 3.asp. And the 
information
: is never updated into the access database.
:
: When I look at the source code, it shows the form action for 3.asp as
: 2.asp.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #4 by "Ken Schaefer" <ken@a...> on Tue, 23 Jul 2002 12:18:57 +1000
Not at all.

I posted a "fake" conversation that would have occured. I was trying to
point out that without seeing any of the source code, there is no real way
we could sort out the real cause of the problem.

Just to make it a little clearer:

>> The error is on line 8 (this is me)

> How do you know? I didn't post any code (this is you)

Exactly (this is me again)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <saslaw@c...>
Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
with quite right.


: I think you responded to the wrong question here.
:
: Al
:
:
: > >> The error is on line 8
: > How do you know? I didn't post any code
: Exactly
:
: Cheers
: Ken
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: <saslaw@c...>
: Subject: [access_asp] HELP ME. Server.transfer question, not working with
: quite right.
:
:
: : I am having some problems with a server.transfer.
: : I am starting on one page, 1.asp, this is a form where users enter new
: : information and this information is submitted into an access database.
: : They then are redirected to another page, 2.asp. On 2.asp they enter
: their
: : email address and this checks the database to ensure they are in there.
: On
: : 2.asp if they are validated, I do server.transfer to the appropriate
: page,
: : 3a.asp, 3b.asp or 3c.asp.
: :
: : On any of the 3.asp they have the option of updating their information
in
: : the database. The problem is when I click on update, it takes me to
: 2.asp,
: : and not the redirect of the update statement on 3.asp. And the
: information
: : is never updated into the access database.
: :
: : When I look at the source code, it shows the form action for 3.asp as
: : 2.asp.
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:

Message #5 by saslaw@c... on Wed, 24 Jul 2002 00:45:10
Very well. I didn't post any code because I don't believe the problem is 
with the code, but rather with how server.transfer works. I was hopeing 
someone recognized the problem and could help.  But here is the code 
nonetheless.

I do a server.transfer here:

if Request.Form("race_name_search") = Recordset1.Fields.Item
("race_name").Value and Request.Form("race_name_search") = "Blackwater" 
then
   	Server.Transfer("blackwater_search.asp")
  	 end if

This works fine. The page is transfered smoothly to blackwater_search.asp.

On the form on the next page, I post to here:

<form name="form1" method="POST" action="<%=MM_editAction%>">


Here is the code for mm_editaction:

MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) <> "") Then

  MM_editConnection = MM_tricolumbia_STRING
  MM_editTable = "tbinformation"
  MM_editRedirectUrl = "submitted.asp"


When I hit submit, I am taken to the page that called the server.transfer, 
and not submitted.asp. And the record is never inserted into the database.

When I view the source, I get this.

<form name="form1" method="post" action="emailsearch.asp">

I believe the problem is a functionality of server.transfer and not 
anything wrong with the code, which is why I didn't post it.

Further more I tested this and put this in:


<form name="form1" method="post" action="test.asp">

I successfully posted to test.asp and inserted the record.


Al


> Not at all.

I posted a "fake" conversation that would have occured. I was trying to
point out that without seeing any of the source code, there is no real way
we could sort out the real cause of the problem.

Just to make it a little clearer:

>> The error is on line 8 (this is me)

> How do you know? I didn't post any code (this is you)

Exactly (this is me again)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <saslaw@c...>
Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
with quite right.


: I think you responded to the wrong question here.
:
: Al
:
:
: > >> The error is on line 8
: > How do you know? I didn't post any code
: Exactly
:
: Cheers
: Ken
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: <saslaw@c...>
: Subject: [access_asp] HELP ME. Server.transfer question, not working with
: quite right.
:
:
: : I am having some problems with a server.transfer.
: : I am starting on one page, 1.asp, this is a form where users enter new
: : information and this information is submitted into an access database.
: : They then are redirected to another page, 2.asp. On 2.asp they enter
: their
: : email address and this checks the database to ensure they are in there.
: On
: : 2.asp if they are validated, I do server.transfer to the appropriate
: page,
: : 3a.asp, 3b.asp or 3c.asp.
: :
: : On any of the 3.asp they have the option of updating their information
in
: : the database. The problem is when I click on update, it takes me to
: 2.asp,
: : and not the redirect of the update statement on 3.asp. And the
: information
: : is never updated into the access database.
: :
: : When I look at the source code, it shows the form action for 3.asp as
: : 2.asp.
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:

Message #6 by "Ken Schaefer" <ken@a...> on Wed, 24 Jul 2002 13:06:10 +1000
I don't think the problem is with the Server.Transfer, but I could be wrong.
However I don't understand which part of your code is on what pages...

From what I can see you are transferring from page1.asp ->
blackwater_search.asp (the first bit of code you submitted)

On blackwater_search.asp you have more ASP code that contains does this:

: MM_editAction = CStr(Request("URL"))

Request("URL") must equal "emailsearch.asp", because your form ends up with:

<form name="form1" method="POST" action="<%=MM_editAction%>">

So, the form posts to emailsearch.asp, but I don't understand what the
problem is there. You then say you have another page called test.asp.

Can you please post a list of the actual pages you have, what order they are
supposed to be in, what each page is supposed to do, and the relevant code
from each page.

Cheers
Ken


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <saslaw@c...>
To: "Access ASP" <access_asp@p...>
Sent: Wednesday, July 24, 2002 12:45 AM
Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
with quite right.


:
: Very well. I didn't post any code because I don't believe the problem is
: with the code, but rather with how server.transfer works. I was hopeing
: someone recognized the problem and could help.  But here is the code
: nonetheless.
:
: I do a server.transfer here:
:
: if Request.Form("race_name_search") = Recordset1.Fields.Item
: ("race_name").Value and Request.Form("race_name_search") = "Blackwater"
: then
:    Server.Transfer("blackwater_search.asp")
:   end if
:
: This works fine. The page is transfered smoothly to blackwater_search.asp.
:
: On the form on the next page, I post to here:
:
: <form name="form1" method="POST" action="<%=MM_editAction%>">
:
:
: Here is the code for mm_editaction:
:
: MM_editAction = CStr(Request("URL"))
: If (Request.QueryString <> "") Then
:   MM_editAction = MM_editAction & "?" & Request.QueryString
: End If
:
: ' boolean to abort record edit
: MM_abortEdit = false
:
: ' query string to execute
: MM_editQuery = ""
: %>
: <%
: ' *** Insert Record: set variables
:
: If (CStr(Request("MM_insert")) <> "") Then
:
:   MM_editConnection = MM_tricolumbia_STRING
:   MM_editTable = "tbinformation"
:   MM_editRedirectUrl = "submitted.asp"
:
:
: When I hit submit, I am taken to the page that called the server.transfer,
: and not submitted.asp. And the record is never inserted into the database.
:
: When I view the source, I get this.
:
: <form name="form1" method="post" action="emailsearch.asp">
:
: I believe the problem is a functionality of server.transfer and not
: anything wrong with the code, which is why I didn't post it.
:
: Further more I tested this and put this in:
:
:
: <form name="form1" method="post" action="test.asp">
:
: I successfully posted to test.asp and inserted the record.
:
:
: Al
:
:
: > Not at all.
:
: I posted a "fake" conversation that would have occured. I was trying to
: point out that without seeing any of the source code, there is no real way
: we could sort out the real cause of the problem.
:
: Just to make it a little clearer:
:
: >> The error is on line 8 (this is me)
:
: > How do you know? I didn't post any code (this is you)
:
: Exactly (this is me again)
:
: Cheers
: Ken
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: <saslaw@c...>
: Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
: with quite right.
:
:
: : I think you responded to the wrong question here.
: :
: : Al
: :
: :
: : > >> The error is on line 8
: : > How do you know? I didn't post any code
: : Exactly
: :
: : Cheers
: : Ken
: :
: : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: : From: <saslaw@c...>
: : Subject: [access_asp] HELP ME. Server.transfer question, not working
with
: : quite right.
: :
: :
: : : I am having some problems with a server.transfer.
: : : I am starting on one page, 1.asp, this is a form where users enter new
: : : information and this information is submitted into an access database.
: : : They then are redirected to another page, 2.asp. On 2.asp they enter
: : their
: : : email address and this checks the database to ensure they are in
there.
: : On
: : : 2.asp if they are validated, I do server.transfer to the appropriate
: : page,
: : : 3a.asp, 3b.asp or 3c.asp.
: : :
: : : On any of the 3.asp they have the option of updating their information
: in
: : : the database. The problem is when I click on update, it takes me to
: : 2.asp,
: : : and not the redirect of the update statement on 3.asp. And the
: : information
: : : is never updated into the access database.
: : :
: : : When I look at the source code, it shows the form action for 3.asp as
: : : 2.asp.
: :
: : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: :
:

Message #7 by saslaw@c... on Thu, 25 Jul 2002 00:38:22
AHhhhh!!! Thats what is happening!

On a server.transfer it doesn't change the browser url window. As far as 
the browser is concerned the page is still emailsearch.asp. But, the way 
in which "<%=MM_editAction%>"> in a form is having the page actually post 
back to itself. The request."url" brings the emailsearch.asp and NOT 
blackwater_search.asp which is where the access stuff is.

Thats what happening, but how the h*** do I fix it.

Ok, here is the code.

page1.asp (emailsearch.asp) has this:

 if Request.Form("race_name_search") = Recordset1.Fields.Item
 ("race_name").Value and Request.Form("race_name_search") = "Blackwater"
 then
    Server.Transfer("blackwater_search.asp")
   end if


which goes to page2.asp (blackwater_search.asp) and that has this:

<form name="form1" method="POST" action="<%=MM_editAction%>">


 Here is the code for mm_editaction:

 MM_editAction = CStr(Request("URL"))
 If (Request.QueryString <> "") Then
   MM_editAction = MM_editAction & "?" & Request.QueryString
 End If

 ' boolean to abort record edit
 MM_abortEdit = false

 ' query string to execute
 MM_editQuery = ""
 %>
  <%
 ' *** Insert Record: set variables

 If (CStr(Request("MM_insert")) <> "") Then

   MM_editConnection = MM_tricolumbia_STRING
   MM_editTable = "tbinformation"
   MM_editRedirectUrl = "submitted.asp"


This CStr(Request("URL")) is asking for the browser URL, which is 
page1.asp (emailsearch.asp) which has NO code in it for running the rest 
of mm_editAction. But in order for the the rest of mm_editAction to work, 
it MUST be page2.asp (blackwater_search.asp) because thats where the code 
is. 

So mm_editaction is actually going to the url in question, then looks for 
code, then runs it.

If I look at source code, I get this on page2.asp

<form name="form1" method="POST" action="page1.asp">

I did a test. I made a direct link to page2.asp, no server.transfer, so 
the browser "knows" it is page2.asp.  I then looked at the source code for 
page2.asp and got this:

<form name="form1" method="POST" action="page2.asp">

mm_editAction needs the current URL to find all the code to run, I think, 
and with server.transfer, the browser never knows the page has changed, so 
mm_editAction for some reason thinks it is on page1.asp, but there is no 
code, so all you get is page1.asp. You also do not get any errors, since 
there isn't anything on page1.asp to go wrong.

What do you think?  I hope that makes sense, I tend to ramble.

Al


> I don't think the problem is with the Server.Transfer, but I could be 
wrong.
However I don't understand which part of your code is on what pages...

From what I can see you are transferring from page1.asp ->
blackwater_search.asp (the first bit of code you submitted)

On blackwater_search.asp you have more ASP code that contains does this:

: MM_editAction = CStr(Request("URL"))

Request("URL") must equal "emailsearch.asp", because your form ends up 
with:

<form name="form1" method="POST" action="<%=MM_editAction%>">

So, the form posts to emailsearch.asp, but I don't understand what the
problem is there. You then say you have another page called test.asp.

Can you please post a list of the actual pages you have, what order they 
are
supposed to be in, what each page is supposed to do, and the relevant code
from each page.

Cheers
Ken


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <saslaw@c...>
To: "Access ASP" <access_asp@p...>
Sent: Wednesday, July 24, 2002 12:45 AM
Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
with quite right.


:
: Very well. I didn't post any code because I don't believe the problem is
: with the code, but rather with how server.transfer works. I was hopeing
: someone recognized the problem and could help.  But here is the code
: nonetheless.
:
: I do a server.transfer here:
:
: if Request.Form("race_name_search") = Recordset1.Fields.Item
: ("race_name").Value and Request.Form("race_name_search") = "Blackwater"
: then
:    Server.Transfer("blackwater_search.asp")
:   end if
:
: This works fine. The page is transfered smoothly to 
blackwater_search.asp.
:
: On the form on the next page, I post to here:
:
: <form name="form1" method="POST" action="<%=MM_editAction%>">
:
:
: Here is the code for mm_editaction:
:
: MM_editAction = CStr(Request("URL"))
: If (Request.QueryString <> "") Then
:   MM_editAction = MM_editAction & "?" & Request.QueryString
: End If
:
: ' boolean to abort record edit
: MM_abortEdit = false
:
: ' query string to execute
: MM_editQuery = ""
: %>
: <%
: ' *** Insert Record: set variables
:
: If (CStr(Request("MM_insert")) <> "") Then
:
:   MM_editConnection = MM_tricolumbia_STRING
:   MM_editTable = "tbinformation"
:   MM_editRedirectUrl = "submitted.asp"
:
:
: When I hit submit, I am taken to the page that called the 
server.transfer,
: and not submitted.asp. And the record is never inserted into the 
database.
:
: When I view the source, I get this.
:
: <form name="form1" method="post" action="emailsearch.asp">
:
: I believe the problem is a functionality of server.transfer and not
: anything wrong with the code, which is why I didn't post it.
:
: Further more I tested this and put this in:
:
:
: <form name="form1" method="post" action="test.asp">
:
: I successfully posted to test.asp and inserted the record.
:
:
: Al
:
:
: > Not at all.
:
: I posted a "fake" conversation that would have occured. I was trying to
: point out that without seeing any of the source code, there is no real 
way
: we could sort out the real cause of the problem.
:
: Just to make it a little clearer:
:
: >> The error is on line 8 (this is me)
:
: > How do you know? I didn't post any code (this is you)
:
: Exactly (this is me again)
:
: Cheers
: Ken
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: <saslaw@c...>
: Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
: with quite right.
:
:
: : I think you responded to the wrong question here.
: :
: : Al
: :
: :
: : > >> The error is on line 8
: : > How do you know? I didn't post any code
: : Exactly
: :
: : Cheers
: : Ken
: :
: : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: : From: <saslaw@c...>
: : Subject: [access_asp] HELP ME. Server.transfer question, not working
with
: : quite right.
: :
: :
: : : I am having some problems with a server.transfer.
: : : I am starting on one page, 1.asp, this is a form where users enter 
new
: : : information and this information is submitted into an access 
database.
: : : They then are redirected to another page, 2.asp. On 2.asp they enter
: : their
: : : email address and this checks the database to ensure they are in
there.
: : On
: : : 2.asp if they are validated, I do server.transfer to the appropriate
: : page,
: : : 3a.asp, 3b.asp or 3c.asp.
: : :
: : : On any of the 3.asp they have the option of updating their 
information
: in
: : : the database. The problem is when I click on update, it takes me to
: : 2.asp,
: : : and not the redirect of the update statement on 3.asp. And the
: : information
: : : is never updated into the access database.
: : :
: : : When I look at the source code, it shows the form action for 3.asp as
: : : 2.asp.
: :
: : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: :
:

Message #8 by "Ken Schaefer" <ken@a...> on Thu, 25 Jul 2002 13:35:42 +1000
Can you use Response.Redirect() instead?

That causes the browser to issue a new request...you may need to change some
of your code though (eg pass variables via cookie or querystring, since the
second page is no longer running in the context of the first page)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <saslaw@c...>
Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
with quite right.


: AHhhhh!!! Thats what is happening!
:
: On a server.transfer it doesn't change the browser url window. As far as
: the browser is concerned the page is still emailsearch.asp. But, the way
: in which "<%=MM_editAction%>"> in a form is having the page actually post
: back to itself. The request."url" brings the emailsearch.asp and NOT
: blackwater_search.asp which is where the access stuff is.
:
: Thats what happening, but how the h*** do I fix it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #9 by saslaw@c... on Fri, 26 Jul 2002 05:03:51
AYe, I tried it with response.redirect and sent over a querystring instead 
of a form post. It worked fine. Does this mean we actually found a reason 
to not use server.transfer?

Thanks for all your help!!!

Al


> Can you use Response.Redirect() instead?

That causes the browser to issue a new request...you may need to change 
some
of your code though (eg pass variables via cookie or querystring, since the
second page is no longer running in the context of the first page)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <saslaw@c...>
Subject: [access_asp] Re: HELP ME. Server.transfer question, not working
with quite right.


: AHhhhh!!! Thats what is happening!
:
: On a server.transfer it doesn't change the browser url window. As far as
: the browser is concerned the page is still emailsearch.asp. But, the way
: in which "<%=MM_editAction%>"> in a form is having the page actually post
: back to itself. The request."url" brings the emailsearch.asp and NOT
: blackwater_search.asp which is where the access stuff is.
:
: Thats what happening, but how the h*** do I fix it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index