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 » Community » Newbie corner » PostgreSQL Connection Errors
Re: PostgreSQL Connection Errors [message #38285 is a reply to message #38283] Sun, 09 December 2012 02:08 Go to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
You are welcome.

This code is from the reference example SQLPostgreSQL (or something like this)

bool PostgreSQLTest::OpenDB()
{
	if(!m_session.Open("host=localhost dbname=test user=test password=test"))
	{
		Exclamation(Format("Error in open: %s", DeQtf(m_session.GetLastError())));
		return false;
	}
	m_array.SetSession(m_session);



You should be able to supply the correct host, and one of your actual db, user and password. For the port part, you should be able to add something like port=5433 to that string.

!m_session.Open("host=localhost port=5433 dbname=mydb user=myusername password=mypassword"))
....


Let me know if it didn't work for you.
 
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: SQL Syntax in PostgreSQL in U++
Next Topic: Final Compilation for Windows. How to create the .exe 101
Goto Forum:
  


Current Time: Sun Aug 24 14:28:22 CEST 2025

Total time taken to generate the page: 0.04962 seconds