Article View: borland.public.cppbuilder.nativeapi
Article #1865Re: Odd ball odbc problem
From: Valence
Date: Mon, 28 May 2007 18:18
Date: Mon, 28 May 2007 18:18
30 lines
1980 bytes
1980 bytes
It should also be noted that the same code:
declare @test int
set @test = 1
raiserror('Test Error',16,1)
Does not return an error when Query1->ExecSQL is called.
Also, the following code does not return an error:
<sql>
declare @pcb_id int
select top 1 @pcb_id = pcb_id from myTable order by [datetime] desc
if @pcb_id is not null begin
insert into marriageTable (pcb_id,myValue) Values (@pcb_id, 123)
if (@@ERROR!=0) update marriageTable set myValue=123 where pcb_id =
@pcb_id
end
else raiserror('Not Found',16,1)
<\sql>
There is a unique key on pcb_id in marriageTable. This should return an
error if there is no pcb_id in myTable, but since the select succeeds, there
is no error reported. The second pcb_id of the same value causes an error
and is noted long enough for the update to succeed, but this error is not
remembered or reported. There is no information available through
SQLGetDiagField.
SQL Server 2000 on 2003. Client is Win XP.
Thoughts? I kinda' suspect the driver.
Technical Details
Message-ID:
<465b1cda$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<465b1803$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,65a02b53e18dcd13 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Valence" <valence.crearer@Itron.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <465b1803$1@newsgroups.borland.com> Subject: Re: Odd ball odbc problem Date: Mon, 28 May 2007 14:18:01 -0400 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 NNTP-Posting-Host: 63.163.143.187 Message-ID: <465b1cda$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1180376282 63.163.143.187 (28 May 2007 11:18:02 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail