If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Access record from link in an email

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-04, 17:30
breeze76 breeze76 is offline
Registered User
 
Join Date: Apr 2004
Posts: 75
Question 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
Reply With Quote
  #2 (permalink)  
Old 11-22-04, 14:59
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 11-22-04, 15:08
breeze76 breeze76 is offline
Registered User
 
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..
Reply With Quote
  #4 (permalink)  
Old 11-22-04, 15:41
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #5 (permalink)  
Old 11-22-04, 17:32
breeze76 breeze76 is offline
Registered User
 
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...
Reply With Quote
  #6 (permalink)  
Old 11-22-04, 19:55
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On