Jump to content

Connecting to postgres problem


Recommended Posts

I have two computers, one running win7 home, the other running win7 pro 64bit.

I have sucessfully connected to a postgres database from auto it using the win 7 home machine,

but can not do so from the win 7 pro 64 bit machine.

The only difference is when installing the ODBC data source, I had to install a 64 bit version and I assume that now the connection string must be different, but I'm not sure.

The code I'm using is as follows:

$oConn = ObjCreate("ADODB.Connection")
$strConn = "DSN=PostgreSQL;DATABASE=mydb;SERVER=localhost;Port=5432;Uid=postgres;Pwd=dbpass"
$oConn.Open($strConn)

On the third line I get an error messsage saying:

Error: The requseted action with this object has failed.

From the Control Panel --> Admin Tools --> Data Sources (ODBC)

I have created a user DSN which when I test gives a successful message.

As I said, this code works fine on the Win7 home computer, is there something simple I am missing? Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...