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 » MSSQL connection cause memory leak
icon9.gif  MSSQL connection cause memory leak [message #47838] Mon, 10 April 2017 09:01 Go to previous message
akebee is currently offline  akebee
Messages: 90
Registered: August 2011
Location: China
Member
my application frequently attempts to connect to the database server.
see the pic:
index.php?t=getfile&id=5224&private=0

and the code:
	while(1)
	{
		MSSQLSession mssql;
		for(;;) {
			String cs = "Driver={SQL Server};";
			cs << "Server=" << "127.0.0.1" << ';';
			String h = "sa";
			if(IsNull(h))
				cs << "Trusted_Connection=Yes;";
			else {
				cs << "UID=" << h << ';';
			//	Cout() << "Password:";
				cs << "PWD=" << pass << ';';
			//	Cout() << "Database (empty for default):";
				h = "";
				if(IsNull(h))
					cs << "Database=" << h << ';';
			}
			Cout() << "Connect mssql:" << cs << "\n";
			if(!mssql.Connect(cs))
				Cout() << "Connect failed: " << mssql.GetLastError() << '\n';
			else
				break;
		}
	
		#ifdef _DEBUG
			mssql.SetTrace();
		#endif			
		
		//do some work
		Sleep(1000);
		
		mssql.Close();
	}
 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to connect to ODBC??
Next Topic: OleDB fails to build
Goto Forum:
  


Current Time: Thu Mar 28 19:41:33 CET 2024

Total time taken to generate the page: 0.00881 seconds