This topic is locked

Send email with new data

12/14/2007 2:07:28 PM
ASPRunnerPro General questions
P
Philip author

Hello
ASPRunner 5.1 (327)
On the EDIT page I use the "before record updated" event with "Send email with new data". Unfortunately I get an error message when I try to open the xxx_LIST.asp page:
[indent]Microsoft VBScript compilation error '800a0411'

Name redefined

xxxxxxxxxxx_events.asp, line 30

Dim keys

----^[/indent]
Question: is this my fault or is it a bug since the whole application worked fine with same code in version 5.0.
Philip

Sergey Kornilov admin 12/14/2007

You need to use another variable name instead of keys.
Here is the example:

Dim dkeys

message =""
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next



email="test@test.com"

subject="New data record"



sendmail email, subject, message
P
Philip author 12/18/2007

You need to use another variable name instead of keys.

Here is the example:

Dim dkeys

message =""
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next
email="test@test.com"

subject="New data record"
sendmail email, subject, message


OK, I changed and it works now.

But still: this code with "Dim keys" is generated by ASPRunner Pro - why not automatically correct?
Thanks,

Philip

Sergey Kornilov admin 12/18/2007

Philip,
this is an ASPRunnerPro bug - we haven't updated sample event code.