From: Chris W. <cw...@cf...> - 2003-06-12 14:46:04
|
Greetings, Thanks much for the suggestion - it put me on the right track. Adding the hosts file, and rebooting had no effect. But, Bob guessed that it was some sort of host resolution problem. So I edited the code from '192.168.1.160' to 'blah.xyz.com', forcing the Win95 box to hit our local DNS server, and it connected fine. Weird. Even weirder - the mail client (mozilla) on this same box is pointed by IP address to our mail server - and it works fine. So is it a Win95 TCP/IP problem? Hmm... Thanks for your time - I'd love a solution, but I'll settle for a fix, and you got me there. Regards, Chris > My guess is that the Windows 95 TCP/IP stack isn't figuring out that > 192.168.1.160 is a TCP/IP address instead of a host name. Perhaps you could > put an entry in your hosts file -- c:\windows\hosts or some such thing -- and > that might trick the TCP/IP stack into resolving the IP address. You should > find c:\windows\hosts.sam file, which you can copy to c:\windows\hosts as a > start if you don't already have one. > > I think good practice is to have a localhost entry, so your hosts file should > have at least the following two entries: > > 127.0.0.1 localhost > 192.168.1.160 foo > > where "foo" is an arbitrary name for your PostgreSQL server. > > HTH. > > .... Bob > > On Wednesday 11 June 2003 22:49, Chris Wren wrote: >> Greetings, >> >> I am having trouble connecting to a FreeBSD PostGreSQL server >> using a Windows 95 client. >> >> The code runs _fine_ on several Win98 clients on the same network. >> The command that breaks is as follows: >> >> _______ >> >> self.db = PgSQL.connect( user = self.uid, host = self.hostname, >> database = self.dbname, password = self.pwd ) >> ________ >> >> The error message I get is as follows: >> ______ >> >> File "C:\Python22\Lib\site-packages\pyPgSQL\PgSQL.py", line 2118, in >> connect >> return Connection(connInfo, client_encoding, unicode_results) >> File "C:\Python22\Lib\site-packages\pyPgSQL\PgSQL.py", line 2215, in >> __init__ >> raise DatabaseError, m >> libpq.DatabaseError: unknown host name: 192.168.1.160 >> >> ________ >> >> Here are the relevant software versions: >> >> ________ >> >> Client: >> Windows 95 >> ActivePython 2.2.2 build 224 >> egenix-mx-base-2.0.4.win32-py2.2 >> pyPgSQL-2.3.win32-py2.2 >> wxPythonWIN32-2.4.0.7-Py22 >> >> Server: >> IP: 192.168.1.160 >> FreeBSD 4.7 >> postgresql-7.2.1_1 >> >> __________ >> >> The Win 95 box seems to have good network connectivity, >> at least it happily accesses a SAMBA server running on the >> same FreeBSD box as the database. >> >> Any clues are, as always, much appreciated. >> >> Thanks, >> >> Chris >> |