Solved

PostgreSQL Connection String Issue

Posted on 2011-03-23
3
2,538 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
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
m_walker earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now