This topic is locked

Sending Email with data entered in another table

1/7/2009 12:44:58 PM
ASPRunnerPro General questions
D
dsk author

My database has multiple tables where I collect data. Table A collects personal data such as name and address of individual, Table C collects data for references (names, addresses, emails.)
On Table C after record added event I am able to send my email to the email address that was added, however, I am not able to input the individuals name from Table A in the message.
Could someone help me with code that will accomplish this?
I am using ASPRunner Pro 5.2 Build 423

J
Jane 1/8/2009

Hi,
to select values from anotehr table use following code a sample:

str = "select field1, field2 from TableA where RecordID_A=" & dict("RecordID_B")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

message = message & "Field1" & " : " & rstmp("field1") & vbcrlf

message = message & "Field2" & " : " & rstmp("field2") & vbcrlf

rstmp.close

set rstmp=nothing

D
dsk author 1/8/2009

Thank you, Jane. It is working beautifully!