Home » U++ Library support » U++ SQL » ODBC Assertion failed
Re: ODBC Assertion failed [message #55823 is a reply to message #55818] |
Fri, 18 December 2020 06:26 |
JeyCi
Messages: 50 Registered: July 2020
|
Member |
|
|
BTW, I can just suggest to make a couple of experiments:
1) try to log your queries with something like (but about your ms sql server)
sqlite3.Open(db)
#ifdef _DEBUG
sqlite3.SetTrace(); //logging queries
#endif
& without Commit & Rollback... AFAIK, such command is being self-rollbacked automatically in the case of error or commited automatically if no errors - in ms sql server - but I have no chance to check it in ms sql server
// initialize transaction
BEGIN TRAN;
// transaction
INSERT INTO sales
VALUES ('7896', 'JR3435', 'Oct 28 1997', 25, 'Net 60', 'BU7832');
2) I'm not sure, that having duplicated PKs the query starts anyway, therefore I'm not sure that you have the right to do Rollback when this error arrised...
therefore you can try just SQL-statement to .Execute, expressing your sql-command in sql-string, not u++ method Insert... something like this - that is doing rollback ONLY IF @@TRANCOUNT > 0
BEGIN TRY
BEGIN TRANSACTION
exec( @sqlHeader)
COMMIT
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK
END CATCH
or check this count in U++ somehow, before rollback - though it seems meaningless in the case of error... If you'd had several queries - you'd had something to rollback if previous queries already done... but in a single Insert failed - nothing to Rollback... imho
Best regards.
[Updated on: Fri, 18 December 2020 06:53] Report message to a moderator
|
|
|
|
|
ODBC Assertion failed
By: Giorgio on Thu, 17 December 2020 11:01
|
|
|
Re: ODBC Assertion failed
By: JeyCi on Thu, 17 December 2020 14:09
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Thu, 17 December 2020 14:22
|
|
|
Re: ODBC Assertion failed
By: JeyCi on Thu, 17 December 2020 15:06
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Thu, 17 December 2020 16:27
|
|
|
Re: ODBC Assertion failed
By: JeyCi on Thu, 17 December 2020 17:44
|
|
|
Re: ODBC Assertion failed
By: JeyCi on Fri, 18 December 2020 06:26
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Fri, 18 December 2020 08:32
|
|
|
Re: ODBC Assertion failed
By: mirek on Fri, 18 December 2020 10:22
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Fri, 18 December 2020 08:26
|
|
|
Re: ODBC Assertion failed
By: mr_ped on Fri, 18 December 2020 14:02
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Mon, 21 December 2020 09:54
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Tue, 22 December 2020 11:44
|
|
|
Re: ODBC Assertion failed
By: mirek on Tue, 22 December 2020 18:22
|
|
|
Re: ODBC Assertion failed
By: mirek on Tue, 22 December 2020 18:49
|
|
|
Re: ODBC Assertion failed
By: JeyCi on Wed, 23 December 2020 06:08
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Wed, 27 January 2021 16:44
|
|
|
Re: ODBC Assertion failed
By: mirek on Wed, 27 January 2021 17:08
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Thu, 28 January 2021 09:26
|
|
|
Re: ODBC Assertion failed
By: mirek on Thu, 28 January 2021 09:38
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Fri, 12 February 2021 18:15
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Fri, 21 May 2021 11:04
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Tue, 25 May 2021 17:16
|
|
|
Re: ODBC Assertion failed
By: mirek on Tue, 08 June 2021 10:08
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Thu, 10 June 2021 17:00
|
|
|
Re: ODBC Assertion failed
By: JeyCi on Mon, 21 December 2020 15:33
|
|
|
Re: ODBC Assertion failed
By: Giorgio on Mon, 24 May 2021 14:54
|
Goto Forum:
Current Time: Sat May 04 16:16:33 CEST 2024
Total time taken to generate the page: 0.02306 seconds
|