Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » ODBC Assertion failed
ODBC Assertion failed [message #55812] Thu, 17 December 2020 11:01 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi there,
I have an application that has to insert some data on a Microsoft SQL Server db.

When the query runs without error the application is ok, the problem is when the query fails for some reason: in that case the application crashes.

This is what I found in the log:

ERROR [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint 'PK_RIG'. Cannot insert duplicate key in object 'dbo.DOROW'. The duplicate key value is [...]
****************** ASSERT FAILED: Assertion failed in C:\Users\GIRU1\ToolsBox\upp-2020.1\uppsrc\ODBC\ODBC.cpp, line 215
tlevel >= 0


This is the code that crashes:

bool InsertDoument(ValueMap * vm){

	Sql query(my_mssql_db);
	query.ClearError();

	query.Begin();

	try{
		query * Insert(My_mssql_table)(*vm);
	} catch(SqlExc) {
		ErrorOK(query.GetLastError());
	}

	if(query.WasError()){
		query.Rollback();
		return false;
	}

	query.Commit();
    return true;
}


Thanks for any hint!
gio


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: OleDBSession in Archive
Next Topic: sqlite3 Custom Function in SqlExp
Goto Forum:
  


Current Time: Thu Apr 25 01:54:51 CEST 2024

Total time taken to generate the page: 0.03204 seconds