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
Re: ODBC Assertion failed [message #55842 is a reply to message #55830] Mon, 21 December 2020 09:54 Go to previous messageGo to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi,
I reviewed my code, but I actually cannot see anything terrible. I have innumerable queries in PostgreSQL that is the rdbms that I currently use, previously I used MySql so I wrote a lot queries with that also, have also a few in sqlite... never a problem. The structure of the code is in my first post: it seems to me very simple and basic. I also tried different combinations of try/catch and .WasErrors() but the behaviour is also the same. Maybe it's the way I open the connection to the db?

(mymssql_db is a private memeber of the class and its type is MSSQLSession).

bool OpenMSSqlDB(){

	String username = "sa";
	String pwd = "mypassword";
	String dbname = "MYDBNAME";
	String server = "servername\\instancename";
	String cs = "Driver={SQL Server};Server=" + server +
					";UID=" + username + ";PWD=" + pwd + ";Database=" + dbname + ";";
	if(!mymssql_db.Connect(cs))
	{
		string err="Unable to connect to MSSql database due to the following error: " + mymssql_db.GetLastError().ToStd();
		this->err_messages->push_back(err);
		return false;
	}

	mymssql_db.ThrowOnError();
	mymssql_db.LogErrors();
	mymssql_db.SetTrace();

	return true;
}


So if you could give me some hints about some tests to perform or what to look for in my code I could really use it.

Thanks,
gio

[Updated on: Mon, 21 December 2020 09:55]

Report message to a moderator

 
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: Wed Jun 25 16:41:30 CEST 2025

Total time taken to generate the page: 0.03923 seconds