Page 1 of 1

Ignore warnings

Posted: Fri 19 Oct 2007 06:07
by palmtreefrb
I have my table set to ignore duplicate keys. However the warning is raised as an exception from TMSQuery. How do I evaluate warnings from true exceptions. Can I ignore warnings with SDAC?

Posted: Fri 19 Oct 2007 07:58
by Antaeus
Do you mean this error message?
Update failed. Found 0 records.
If you do, you should set the StrictUpdate option of TMSQuery to false to get rid of it.

If you get another message, please post its exact text. Also describe in more details, in what situation does it arise.

Posted: Fri 19 Oct 2007 14:25
by palmtreefrb
Warning: Duplicate key was ignored.'
Antaeus wrote:Do you mean this error message?
Update failed. Found 0 records.
If you do, you should set the StrictUpdate option of TMSQuery to false to get rid of it.

If you get another message, please post its exact text. Also describe in more details, in what situation does it arise.

Posted: Fri 19 Oct 2007 14:32
by palmtreefrb
Also, another "Warning" that other Data Access components would not raise an error on is...
The statement has been terminated.'String or binary data would be truncated.'
palmtreefrb wrote:'Warning: Duplicate key was ignored.'
Antaeus wrote:Do you mean this error message?
Update failed. Found 0 records.
If you do, you should set the StrictUpdate option of TMSQuery to false to get rid of it.

If you get another message, please post its exact text. Also describe in more details, in what situation does it arise.

Posted: Fri 19 Oct 2007 14:45
by palmtreefrb
I should indicate I am using the TMSQuery to insert records in both cases.
palmtreefrb wrote:Also, another "Warning" that other Data Access components would not raise an error on is...
The statement has been terminated.'String or binary data would be truncated.'
palmtreefrb wrote:'Warning: Duplicate key was ignored.'
Antaeus wrote:Do you mean this error message? If you do, you should set the StrictUpdate option of TMSQuery to false to get rid of it.

If you get another message, please post its exact text. Also describe in more details, in what situation does it arise.

Posted: Mon 22 Oct 2007 07:51
by Antaeus
I could not reproduce the problem.
Please send me a complete small sample at sdac*crlab*com to demonstrate it, including script to create table.

Also supply me the following information:
- exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- exact version of your IDE;
- exact version of SQL Server and client. You can see it in the Info sheet of TMSConnection Editor.

Posted: Thu 25 Oct 2007 15:32
by palmtreefrb
It is easy to reproduce. Just create a Unique Key and set the properties to "Ignore Duplicate Keys".

CREATE UNIQUE NONCLUSTERED INDEX [IX_mytable] ON [dbo].[mytable]
(
[DATE_BATCH] ASC
)WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY]

Then from TMSQuery insert a record into table with a duplicate key. It will raise an "Error" for the "Warning"

Posted: Thu 25 Oct 2007 15:34
by palmtreefrb
Sorry Forgot...

SQL Server 2005
SDAC ver 4.30.0.12 Delphi 6
palmtreefrb wrote:It is easy to reproduce. Just create a Unique Key and set the properties to "Ignore Duplicate Keys".

CREATE UNIQUE NONCLUSTERED INDEX [IX_mytable] ON [dbo].[mytable]
(
[DATE_BATCH] ASC
)WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY]

Then from TMSQuery insert a record into table with a duplicate key. It will raise an "Error" for the "Warning"

Posted: Thu 25 Oct 2007 15:38
by palmtreefrb
Provider...
Microsoft SQL Server: 09.00.3042
Microsoft OLE DB Provider for SQL Server: 08.00.1117
palmtreefrb wrote:Sorry Forgot...

SQL Server 2005
SDAC ver 4.30.0.12 Delphi 6
palmtreefrb wrote:It is easy to reproduce. Just create a Unique Key and set the properties to "Ignore Duplicate Keys".

CREATE UNIQUE NONCLUSTERED INDEX [IX_mytable] ON [dbo].[mytable]
(
[DATE_BATCH] ASC
)WITH (IGNORE_DUP_KEY = ON) ON [PRIMARY]

Then from TMSQuery insert a record into table with a duplicate key. It will raise an "Error" for the "Warning"

Posted: Fri 26 Oct 2007 07:03
by Antaeus
I reproduced this problem. I can suggest you the following ways to avoid it:
1) Install SQL Server Native Client and make sure that SDAC uses it (provider version must be 09.xx.xxxxx).
2) Place the following code to the TMSConnection.OnError event handler:

Code: Select all

    if e.ErrorCode = 3604 then
      Fail := False;

Posted: Mon 29 Oct 2007 18:11
by palmtreefrb
Thanks,
Is there a single dll of the new native client that I can include in the application directory. Older versions of the native client I could include ntwdblib.dll. What is the name of the new native client dll?
Antaeus wrote:I reproduced this problem. I can suggest you the following ways to avoid it:
1) Install SQL Server Native Client and make sure that SDAC uses it (provider version must be 09.xx.xxxxx).
2) Place the following code to the TMSConnection.OnError event handler:

Code: Select all

    if e.ErrorCode = 3604 then
      Fail := False;

Posted: Tue 30 Oct 2007 15:59
by Antaeus
I do not think that there is a way to install SQL Native Client just by coping certain files. Anyway we cannot guarantee that SDAC will work properly in this case.