Page 1 of 1

problem with notifications

Posted: Sun 11 Oct 2015 22:40
by LHSoft
Hello,

I've read https://msdn.microsoft.com/en-us/library/ms181122.aspx.

My notifications work fine (normaly)
But when adding a Where condition with date- or datetime-fields, the statement alerts not supporting notification:

Code: Select all

WHERE date>'1.1.2015'
If not using date field in WHERE statement but only in the select statement there is no problem.

Can I avoid this?

Best regards
Hans

Re: problem with notifications

Posted: Fri 16 Oct 2015 11:19
by AlexP
Hello,

Yes, indeed, when using DATE fields in the WHERE clause of the query, an error occurs.
Server returns the status invalid. Try to contact SQL Server developers concerning support for such fields in notification.

P.S. Below is the full server response:

Code: Select all

<qn:QueryNotification xmlns:qn="http://schemas.microsoft.com/SQL/Notifications/QueryNotification" id="0" type="subscribe" source="statement" info="invalid" database_id="0" sid="0x01"><qn:Message>16193042</qn:Message></qn:QueryNotification>

Re: problem with notifications

Posted: Thu 28 Jan 2016 12:11
by LHSoft
Hello,
coincidentally I have found a reason for this error:
If using your AddWhere I have to input Dates like

Code: Select all

AddWhere('Date=''' + DateToStr(Date) + '''');
for today.
If using SQL I can do

Code: Select all

SQL.Add('WHERE Date=:Date');
ParamByName('Date').AsDate := Date;
When working with params there is no notification error.

So is there anything you can do behind when using your AddWhere and DeleteWhere?

best regards
hans

Re: problem with notifications

Posted: Thu 28 Jan 2016 13:07
by AlexP
AddWhere and DeleteWhere methods just add/delete corresponding lines to the where clause. If you add your code with parameters in AddWhere, then it will work just like the last code abstract.

Re: problem with notifications

Posted: Thu 28 Jan 2016 17:07
by LHSoft
OK, just tested.
Works correct.
So this case seems to force always to use params.

By the way, didn't you get my support request cause I got no email-copy though having requested on your form. (And no answer yet too :( )

Best regards
Hans

Re: problem with notifications

Posted: Fri 29 Jan 2016 13:07
by AlexP
Unfortunately, we haven't received your letter, please send it once more to support*devart*com .

Re: problem with notifications

Posted: Sat 30 Jan 2016 11:44
by LHSoft
Just have sent an email with Textfile trace.txt attached

best regards
Hans

Re: problem with notifications

Posted: Tue 02 Feb 2016 09:14
by azyk
We have received your e-mail with attachment and answered you. Please check your inbox.

Re: problem with notifications

Posted: Tue 02 Feb 2016 09:28
by LHSoft
Hi,

for your Information:
your Email was rejected by spamassassin. This might be important Info for you.
Can you please send it again, I have disabled spamassassin for you.

Her is the log:

Code: Select all

[SMTP 000222 02-02-16 10:07:14] MAIL FROM:<support*devart*com> SIZE=1036
[SMTP 000222 02-02-16 10:07:14] Verifying domain devart*com
[SMTP 000222 02-02-16 10:07:14] 250 Sender "support*devart*com" OK...
[SMTP 000222 02-02-16 10:07:15] RCPT TO:<[email protected]>
[SMTP 000222 02-02-16 10:07:15] Returned greylisted connection
[SMTP 000222 02-02-16 10:07:15] 250 Local recipient "[email protected]" OK...
[SMTP 000222 02-02-16 10:07:15] DATA
[SMTP 000222 02-02-16 10:07:15] Checking reverse PTR entry...
[SMTP 000222 02-02-16 10:07:15] Result: mail*devart*com
[SMTP 000222 02-02-16 10:07:15] Checking SPF
[SMTP 000222 02-02-16 10:07:15] TXT Records for devart.com are not in cache
[SMTP 000222 02-02-16 10:07:15] Retrieving TXT records for devart.com using DNS server 178.248.241.4
[SMTP 000222 02-02-16 10:07:15] Registering TXT records with cache
[SMTP 000222 02-02-16 10:07:15] SPF Result: (+) The IP address <ip> is in the permitted set
[SMTP 000222 02-02-16 10:07:15] Performing country lookup for peer 65.60.42.236
[SMTP 000222 02-02-16 10:07:15] Country code: US
[SMTP 000222 02-02-16 10:07:15] SPF result is PASS, agressive address verification will be not performed
[SMTP 000222 02-02-16 10:07:15] 354 Enter mail, end with "." on a line by itself
[SMTP 000222 02-02-16 10:07:15] Received 1003 bytes
[SMTP 000222 02-02-16 10:07:15] Trusted connection or checking RECEIVED headers with DNSBL is disabled
[SMTP 000222 02-02-16 10:07:15] Processing text filters
[SMTP 000222 02-02-16 10:07:15] Processing attachment filters
[SMTP 000222 02-02-16 10:07:15] Calling ClamAV
[SMTP 000222 02-02-16 10:07:15] No viruses found
[SMTP 000222 02-02-16 10:07:15] Running through spamassassin
[SMTP 000222 02-02-16 10:07:17] Appears to be a spam
[SMTP 000222 02-02-16 10:07:17] Rejecting...
[SMTP 000222 02-02-16 10:07:17] 550 Rejected by SpamAssassin

Re: problem with notifications

Posted: Tue 02 Feb 2016 09:51
by azyk
Thank you for the information. I have re-sent the answer to the e-mail.