problem with notifications

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

problem with notifications

Post by LHSoft » Sun 11 Oct 2015 22:40

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: problem with notifications

Post by AlexP » Fri 16 Oct 2015 11:19

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>

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: problem with notifications

Post by LHSoft » Thu 28 Jan 2016 12:11

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: problem with notifications

Post by AlexP » Thu 28 Jan 2016 13:07

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.

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: problem with notifications

Post by LHSoft » Thu 28 Jan 2016 17:07

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: problem with notifications

Post by AlexP » Fri 29 Jan 2016 13:07

Unfortunately, we haven't received your letter, please send it once more to support*devart*com .

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: problem with notifications

Post by LHSoft » Sat 30 Jan 2016 11:44

Just have sent an email with Textfile trace.txt attached

best regards
Hans

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: problem with notifications

Post by azyk » Tue 02 Feb 2016 09:14

We have received your e-mail with attachment and answered you. Please check your inbox.

LHSoft
Posts: 104
Joined: Sat 18 Aug 2012 08:33

Re: problem with notifications

Post by LHSoft » Tue 02 Feb 2016 09:28

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:<service@lhsoft.de>
[SMTP 000222 02-02-16 10:07:15] Returned greylisted connection
[SMTP 000222 02-02-16 10:07:15] 250 Local recipient "service@lhsoft.de" 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

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: problem with notifications

Post by azyk » Tue 02 Feb 2016 09:51

Thank you for the information. I have re-sent the answer to the e-mail.

Post Reply