Opened 17 months ago

Last modified 16 months ago

#372 new task

pqxx::connection leads to runtime error

Reported by: anonymous Owned by: jtv
Priority: normal Component: connections
Severity: Other Keywords: connection
Cc:

Description

Situation is following: When I tried to connect to DB using connection typedef, my application is failed and threw runtime exception: Microsoft C++ exception: pqxx::broken_connection at memory location 0x0026F758. Problem occurs at this row of my code: pqxx::connection C("dbname=myDB user=postgres password=passdb hostaddr=127.0.0.1 port=5432"); I tried to debug the code, error occurs in this constructor: explicit basic_connection(const char opt[]) :

connection_base(m_policy), m_options(opt?opt:std::string()), m_policy(m_options)

{ init(); }

Tested with 4.0.1 and 5.0 versions of libpqxx library Environment: Win7 and VS2013

note: I can connect to this db using the libpq library.

Change History (1)

comment:1 Changed 16 months ago by jtv

When you get an error, always look at the error message! Obviously this exception means that something goes wrong with the connection, but you'll need to look at its actual message to figure out what the error is.

Note: See TracTickets for help on using tickets.