If that is the whole code, then i'm trying to wrap my mind around the fact, that you connect to a PG-Server without providing
1) a Hostname/IP-Adress of the server
2) A Port-Number
3) A UserName/Password
4) The sqldb-Trinity is not interconnected
Nevermind, that i don't see anywhere in your code, that you "create" your Classes
And then you complain it crashes when setting Connected to False???
It would surprise me, if the Connection even gets the state of "Connected=True" in the first place.
Guess: the "second" access to a Property of the connection causes AV, because it doesn't exist (Null-Pointer)