This topic is locked

Error when there are no records - null?

3/29/2009 8:55:29 AM
ASPRunnerPro General questions
B
bhicks11 author

Dim dkeys

dim all_emails

dim mSQL
This email notification (After Add Event) causes an error when I add my first record(s) because there are no emails to run the SQL on. I tried to add:
if dict("Project") not is Null Then
run email notifications . . .
But still get an error. Any ideas?

R
Roger 3/29/2009

Dim dkeys

dim all_emails

dim mSQL
This email notification (After Add Event) causes an error when I add my first record(s) because there are no emails to run the SQL on. I tried to add:
if dict("Project") not is Null Then
run email notifications . . .
But still get an error. Any ideas?


Use IsNull. That'll fix it.
Roger

B
bhicks11 author 3/29/2009



Use IsNull. That'll fix it.
Roger


Thanks Roger. Yes I thought that also and tried it but got this error:
Microsoft VBScript compilation error '800a03f9'
Expected 'Then'
/NPDES/include/DESIGN_PROFESSIONALS_DEVELOPERSRESPONSIBILITIESADD_events.asp, line 128
if dict("Project") Not IsNull Then

-------------------^

R
Roger 3/29/2009



Thanks Roger. Yes I thought that also and tried it but got this error:
Microsoft VBScript compilation error '800a03f9'
Expected 'Then'
/NPDES/include/DESIGN_PROFESSIONALS_DEVELOPERSRESPONSIBILITIESADD_events.asp, line 128
if dict("Project") Not IsNull Then

-------------------^


Try this: if IsNull(dict("Project")) then ... (in other words, invert/reverse your logic...)
OR
if not IsNull(dict("Project")) Then...
In the programming world, you can't use a variable and then a Conditional Directive AFTER the variable.
Hope this helps.
Roger

B
bhicks11 author 3/29/2009



Try this: if IsNull(dict("Project")) then ... (in other words, invert/reverse your logic...)
OR
if not IsNull(dict("Project")) Then...
In the programming world, you can't use a variable and then a Conditional Directive AFTER the variable.
Hope this helps.
Roger


Thanks Roger - I ended up approaching it from a different design direction. Appreciate your help.