I had this same issue, and spent some time searching the forum and google....come to find out it wasn't the ADODB.Connection or my code. If you're trying to connect to postgreSQL from Windows, you need to make sure your DSN in setup properly. Control Panel -> Administrative Tools -> Data Sources(ODBC). If you don't see a User DSN called PostgreSQL, this is likely part of the issue. Details on setting this up here: http://www.developer.com/open/article.php/631251 Then you need to use the DSN properly with the driver parameter in your code. So I setup the Postgre ANSI DSN and here is the code: $oConn = ObjCreate("ADODB.Connection")
$line2 = "DRIVER={PostgreSQL ANSI};Server=localhost;Port=5432;Database=test;Uid=postgres;Pwd=test;"
$oConn.Open ($line2) Your driver parameter would be 'PostgreSQL UNICODE' if that's the DSN and database setup you've chosen. Also, if you're not connecting to localhost, make sure your server is accepting external connections. Checking this with pgadmin is simple.