Passing variables so I can update - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Passing variables so I can update

I am working on an ASP project where I built a user interface(using textboxs) connected to an Access DB. I am able to pass a search variable in the search.asp to the results.asp to pull specific record from page to page to view all fields of reqeusted record. Now I need to be able to update the record. What I want to do is call an update.asp page from the results.asp page and transfer all the fields from results.asp to update.asp and then update them here,and redirect.
My problem is that I am unable to transfer fields from results.asp to update.asp. Below is code to help understand my dilemma and see if there is anything wrong in my code.

=================MANAGERSEARCH.ASP===============================
<%@ Language=VBScript %>




GP
3RD PARTY SOFTWARE MANAGER

image



image




========================MANAGERTEST(RESULTS).ASP==================

<%@ Language=VBScript %>
<%Response.Buffer = True%>

// Set these to true to enable debugging or tracing
@set @debug=false
@set @trace=false


<% ' VI 6.0 Scripting Object Model Enabled %>

<% if StartPageProcessing() Then Response.End() %>

<%Response.Buffer = True%>





Sub BtnUpdate_onclick()
Response.Redirect "ManagerUpdate.asp"
End Sub







<%
dim TConn
dim QUser
dim WUID
dim RS
dim RSUserID

dim SKey
SKey = Request.Form("txtFilter")

set TConn = Server.CreateObject("ADODB.Connection")
TConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("GPDataCleardbsGP3rdParty.mdb"))

WUID = "Select * From USERS where USERID ='"
WUID = WUID & SKey & "'"
set RS = TConn.Execute(WUID)

if RS.EOF = true then
Response.Redirect "ManagerSearch.asp"
end if

'----------------------
RSUserID = RS("UserID")

'------------------------------

While not RS.EOF
RS.MoveNext
wend
RS.Close
set RS = Nothing

%>

">

 





function _initbtnUpdate()
{
btnUpdate.value = 'Update';
btnUpdate.setStyle(0);
}
function _btnUpdate_ctor()
{
CreateButton('btnUpdate', _initbtnUpdate, null);
}

<% btnUpdate.display %>



<% ' VI 6.0 Scripting Object Model Enabled %>
<% EndPageProcessing() %>



============================MANAGERUPDATE.ASP=================
<%@ Language=VBScript %>
<%Response.Buffer = True%>







<%
dim TConn
dim QUser
dim WUID
dim RS

dim SKey

Skey = Request.Form("thisForm.txtBeta")
'UpKey = Trim(UpKey)

Response.Write SKey <======HERE IS WHERE IT IS NOT PASSING THE VARIABLE FROM THE RESULTS PAGE.


Does anyone know what the problem or the solution is???

Thanks,
Jose

Comments

  • leeosleeos Posts: 1,212Member
    : I am working on an ASP project where I built a user interface(using textboxs) connected to an Access DB. I am able to pass a search variable in the search.asp to the results.asp to pull specific record from page to page to view all fields of reqeusted record. Now I need to be able to update the record. What I want to do is call an update.asp page from the results.asp page and transfer all the fields from results.asp to update.asp and then update them here,and redirect.
    : My problem is that I am unable to transfer fields from results.asp to update.asp. Below is code to help understand my dilemma and see if there is anything wrong in my code.
    :
    : =================MANAGERSEARCH.ASP===============================
    : <%@ Language=VBScript %>
    :
    :
    :
    :
    :
    :
    :

    GP
    : 3RD PARTY SOFTWARE MANAGER

    :

    image

    :
    :

    :


    :
    :

    :
    :

    image

    :
    :
    :
    :
    : ========================MANAGERTEST(RESULTS).ASP==================
    :
    : <%@ Language=VBScript %>
    : <%Response.Buffer = True%>
    :
    : // Set these to true to enable debugging or tracing
    : @set @debug=false
    : @set @trace=false
    :
    :
    : <% ' VI 6.0 Scripting Object Model Enabled %>
    :
    : <% if StartPageProcessing() Then Response.End() %>
    :
    : <%Response.Buffer = True%>
    :
    :
    :
    :
    :
    : Sub BtnUpdate_onclick()
    : Response.Redirect "ManagerUpdate.asp"
    : End Sub
    :
    :
    :
    :
    :
    :
    :
    : <%
    : dim TConn
    : dim QUser
    : dim WUID
    : dim RS
    : dim RSUserID
    :
    : dim SKey
    : SKey = Request.Form("txtFilter")
    :
    : set TConn = Server.CreateObject("ADODB.Connection")
    : TConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("GPDataCleardbsGP3rdParty.mdb"))
    :
    : WUID = "Select * From USERS where USERID ='"
    : WUID = WUID & SKey & "'"
    : set RS = TConn.Execute(WUID)
    :
    : if RS.EOF = true then
    : Response.Redirect "ManagerSearch.asp"
    : end if
    :
    : '----------------------
    : RSUserID = RS("UserID")
    :
    : '------------------------------
    :
    : While not RS.EOF
    : RS.MoveNext
    : wend
    : RS.Close
    : set RS = Nothing
    :
    : %>
    :
    :

    ">

    :
    :

    :


    :
    :
    :
    : function _initbtnUpdate()
    : {
    : btnUpdate.value = 'Update';
    : btnUpdate.setStyle(0);
    : }
    : function _btnUpdate_ctor()
    : {
    : CreateButton('btnUpdate', _initbtnUpdate, null);
    : }
    :
    : <% btnUpdate.display %>
    :
    :
    :

    :
    :
    : <% ' VI 6.0 Scripting Object Model Enabled %>
    : <% EndPageProcessing() %>
    :
    :
    :
    : ============================MANAGERUPDATE.ASP=================
    : <%@ Language=VBScript %>
    : <%Response.Buffer = True%>
    :
    :
    :
    :
    :
    :
    :
    : <%
    : dim TConn
    : dim QUser
    : dim WUID
    : dim RS
    :
    : dim SKey
    :
    : Skey = Request.Form("thisForm.txtBeta")
    : 'UpKey = Trim(UpKey)
    :
    : Response.Write SKey <======HERE IS WHERE IT IS NOT PASSING THE VARIABLE FROM THE RESULTS PAGE.
    :
    :
    : Does anyone know what the problem or the solution is???
    :
    : Thanks,
    : Jose
    :

    I had this problem as well. On your redirect if you add your variables in as well they will be transfered an available on QueryString in Update.asp

    Heres something from my code:

    Response.Redirect"index.asp?UserNo="&userno


    For that to work your going to need:

    <% Response.Buffer = true %>

    before your header.


    Hope that helps

    LA



Sign In or Register to comment.