Passing data to next page

Results 1 to 3 of 3

Thread: Passing data to next page

  1. #1
    Cary Lawler Guest

    Default Passing data to next page

    Using an Access Database with 1000 links and an ASP page, I create a menu of links for the user to click.<BR><BR>I can create 1000 html target pages, or one page to list the data which is similar for each record, (Name,Address,....).<BR><BR>I successfully passed the record ID via a session variable but on the target page I can not get the SQL statement to work with a variable, see below.<BR><BR>&#060;%<BR>dim LinkID<BR>LinkID = int(Session("LinkID"))<BR>Response.Write LinkID &#039 test transfer<BR> cSQL="SELECT * FROM tblOffice where ID=&#039LinkID&#039 ORDER BY Office ASC"<BR> Set rsResult=objConn.Execute(cSQL)<BR>%&#062;<BR>I get several different Errors depending on the syntax I use.<BR><BR>What I am trying to do is dynamically generate a page based on the link the user ckicks.<BR><BR>Actual Link&#062;&#062;&#062;&#062;&#062;&#062;&#062; &#060;a href="Auditor.asp"&#062;Auditor&#060;/a&#062; This works fine with the target page SQL statement:<BR>&#060;%<BR> cSQL="SELECT * FROM tblOffice where Office=&#039Auditor&#039" <BR> Set rsResult=objConn.Execute(cSQL)<BR>%&#062;<BR>I want to pass the word "Auditor" in a variable, can this be done?<BR><BR>If someone can point me in a better direction, suggest some key words to re-search I will appreciate it.<BR><BR>Cary Lawler<BR>Paris, Texas

  2. #2
    Batty Guest

    Default RE: Passing data to next page

    Cary,<BR><BR>Maybe you can try passing the Variable as a querystring.<BR><BR>Also, I think you have made the LinkID in to an interger.. if its a number field in your access database, your sql needs to be...<BR><BR>cSQL="SELECT * FROM tblOffice where ID=" & LinkID & "ORDER BY Office ASC" <BR><BR>Also, if you cant get this to work, try <BR>cSQL="SELECT * FROM tblOffice <BR><BR>Make sure that works.. then..<BR><BR>cSQL="SELECT * FROM tblOffice where ID=" & LinkID<BR><BR>Let me know what error messages are generated.<BR><BR> <BR>

  3. #3
    Cary Lawler Guest

    Default RE: Passing data to next page

    Thanks Batty,<BR><BR>Your SQL syntax works great. Can you point me in some direction where I might learn to "trap" a clicked link before it gets to the server?<BR><BR>I don&#039t mind doing my own research, I just don&#039t have a clue where to start, some key words to look up would be fine.<BR><BR>Thanks again,<BR>Cary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts