Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Client Connection Problem

Status
Not open for further replies.

gwinn7

Programmer
Feb 10, 2001
1,004
US
I installed the PostgreSQL ODBC driver to my Windows 2000 workstation. After configuring it and trying it out, I get the following message:

&quot;No pg_hba.conf entry for host <ipaddress> user <username>, database Template1&quot;

Click ok, then

&quot;Couldn't read this file.&quot;

I had to create the pg_hba.conf file manually and it has the following entries...

local all trust
host all 0.0.0.0 0.0.0.0 trust

The database was restarted and displayed as running. I did apply the -i switch for TCP/IP sockets.

On the Windows 2000 workstation, I configured a user DSN with the PostgreSQL driver to connect to the IP address of the PostgreSQL machine and the database is set to Template1. When I try to open the database using MS Query (database query application), the error message results. I also tried to specify my user name in the entry list,but that failed too.

Any ideas?

Thanks in advance,
Gary
gwinn7
 
Problem resolved

I had a duplicate pg_hba.conf file. This file should be located in the same folder as your database cluster. In my case, this was /usr/lib/pgsql/Data. So, I simply made my changes there, restarted Postgres, and poof! Fixed.

Then, I created a database in addition to the Template1 provided by Postgres. I had trouble connecting to the Template1 database, so I created one called, &quot;Test&quot;. That did the trick. I am able to connect through MS Access/ODBC from a Windows 2000 workstation and upload, modify, and manipulate data by simply linking the test table I created in Postgres.

I hope this helps anyone with similar problems.

Cheers,

Gary
gwinn7
 
local all trust
host all 0.0.0.0 0.0.0.0 trust

^^^^^^^^^ ^^^^^^^

wouldn't this open up all the databases on your system to anyone ?

if you are on an internal network i would put in an ip such as 10.140.1.0 and then 255.255.255.0 to mask it ...

Steve
 
SteveBrett,

Yes, this is true, but its only temporary to get things going. Thank you for your concern and feedback.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top