Solved

PostgreSQL Connection String Issue

Posted on 2011-03-23
3
2,596 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
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, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

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