Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    75

    Question Unanswered: Access record from link in an email

    I know this is asp.. but my code is on an asp page...

    Ok.. I have a form the user fills out. An email is sent to them and one to our office with a link to the DB so they can view all the info. My form works fine, my emails work fine. The info gets inserted in to the DB fine.

    What I would like to do is:
    When the link is sent to our office, I would like it so when they click the link it opens the DB right to the info from the link. You know, like when you get an email from here saying someone posted your link has it set so when you click it, it will go right to that post.

    So there you have it, any takers.. I sure could use this, otherwise they open the DB and have to search for the info and they do not like having to do much work..LOL

    Thanks in advance..

    breeze76

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    So what happens right now? Do you put the URL in the email but it's not clickable? You should be able to change the format of the email from text to html, then you code the body of the email like that of a webpage. Your link would be an <a href> tag.
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Apr 2004
    Posts
    75
    Quote Originally Posted by Seppuku
    So what happens right now? Do you put the URL in the email but it's not clickable? You should be able to change the format of the email from text to html, then you code the body of the email like that of a webpage. Your link would be an <a href> tag.
    I put the link in the email, they can click and I have it set to go to an asp page that shows the DB, but what I would like it to do, is when you click the link it goes to the asp page, BUT, it goes to the record that I am trying to send in the link.. you know link here, when you get an email from here saying someone posted in this topice, it has the link so when you click it, you come right to the post... I am going to move the email below the db entry part, it autonumbers when added to the db, I just need to figure out once it is added, how do I get the record number that was just added so I can send it along with the link.. Like so: http://blah.com/dbRecord?id=2 something like that, then it will go right to the record..

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Ok.. then you put that link in the email, and you write into your ASP page some logic to look for that querystring value. If it exists, you query the DB with that value and display the results. Are you sure you want it to go directly to the record though? No authentication required?
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    Apr 2004
    Posts
    75
    Well.. the email will be ineroffice, through our exchange server, so the only people getting the mail are the ones in the office and they will be accessing the db right off the server. The users email only sends a comformation of the form they filled out...

    So with that, after I insert all the data in the DB, how do I call it back up or get the auto-id number from the DB so I can send the query request in email?

    Thanks again...

  6. #6
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    The easiest way is to put your insert statement into a stored procedure. SPs can use a keywords for retrieving the last ID number of an auto incremented table (in MS SQL Server, there are two.. one is global, so you get the last ID number across all the SPs that could be executing concurrently, and a second that gets the last ID number of the current session). Then you return that ID number back to your ASP page, and use it in your email. If you're using MS Access, you're probably stuck with doing a query right after your insert which selects the top 1 row from the table ordered by the row identifier. This is not necessarily accurate though because concurrent submissions may insert multiple rows before your select query runs to get the id number.
    That which does not kill me postpones the inevitable.

Posting Permissions

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