?
Solved

PostgreSQL Connection String Issue

Posted on 2011-03-23
3
Medium Priority
?
2,611 Views
Last Modified: 2012-05-11
I recently migrated desktops. I had a vbscript that used to run on an hourly basis that had a postgresql connection string in it and that connection string seems to be giving me feedback. The only difference in systems (major noteworthy change) is that I went from PostgreSQL 8.4 to 9.0. I have verified that the drivers are in place. ODBC connection didn't seem to be necessary on my old machine. Here are the important lines from the vbscript:
Set Conn = wscript.CreateObject("ADODB.Connection")
ConnectionString = "Driver={PostgreSQL UNICODE};Server=server;Port=5432;Database=database;UID=postgres;PWD=password;"
'...some stuff gets done here...'
conn.Open ConnectionString
'...moar stuff gets done below here...'

Open in new window


And here is the error I receive upon execution:

Line: 3
Character: 3
Error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Even though the error is coming from the ODBC Driver Manager, the old box doesn't have a valid odbc, nor is the odbc name specified anywhere in the original script. It all seemed to operate just fine from the connection string alone. The pg_hba.conf file has the remote connection information specified properly as well. I verified this. Anyone have any ideas? Obviously I can provide more info where necessary. Thanks in advance everyone!
0
Comment
Question by:lffit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
m_walker earned 2000 total points
ID: 35202729
while you may not need to have the odbc connection setup, it will still use the odbc framework to make the connection.  In your odbc manager is the drive name still the same.

Driver={PostgreSQL UNICODE};

as per attached image.
postgres-odbc.PNG
0
 

Author Closing Comment

by:lffit
ID: 35206134
So far that looks like it may be the answer. The driver name has changed from "PostgreSQL Unicode" to "PostgreSQL ODBC Driver(Unicode)." I have updated a test script and it seems to be functioning well now.
0
 
LVL 4

Expert Comment

by:m_walker
ID: 35206201
Glad to help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question