[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PostgreSQL Connection String Issue

Posted on 2011-03-23
3
Medium Priority
?
2,701 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 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

830 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