Ignore warnings
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
Ignore warnings
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?
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
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.Update failed. Found 0 records.
If you get another message, please post its exact text. Also describe in more details, in what situation does it arise.
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
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.'
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.Update failed. Found 0 records.
If you get another message, please post its exact text. Also describe in more details, in what situation does it arise.
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
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.
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.
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.
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
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"
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"
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
Sorry Forgot...
SQL Server 2005
SDAC ver 4.30.0.12 Delphi 6
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"
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
Provider...
Microsoft SQL Server: 09.00.3042
Microsoft OLE DB Provider for SQL Server: 08.00.1117
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"
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:
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;
-
- Posts: 13
- Joined: Fri 12 Nov 2004 21:06
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?
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;