Re: How To Connect PostgreSQL thru VB without DSN - Mailing list pgsql-odbc

From Campbell, Greg
Subject Re: How To Connect PostgreSQL thru VB without DSN
Date
Msg-id 441C8709.2080004@us.michelin.com
Whole thread Raw
In response to How To Connect PostgreSQL thru VB without DSN  ("pragadheeswaran gopalakrishnan" <pragadheeswaran@gmail.com>)
List pgsql-odbc
Your connection string looks fine, assuming that it is all really on one line.

Your error sounds like your Driver is not properly installed.
Troubleshooting:
1. In the ODBC Administrator, check the Drivers tab. Is "PostgreSQL" listed. (This corresponds to the
{PostgreSQL}  in your connection string.
2. In registry check HKLM\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL -- There will be keys elaborating the
location of .dlls. Do those DLLs exist.

What version is your PostgreSQL server?
3. Check, does your server permit remote connections?
In postgresql.conf that TCPIP_SOCKET parameter in version up to 7.4 (I think) and parameter
listen_addreses in version 8+.
4. Does your PostgreSQL server permit the username and password your are trying to supply from your
location? Check pg_hba.conf settings.

Other checks (just for troubleshooting).
Does it work if you use "DSN=myDSNname" type connection string?
Can you connect with pgAdmin?

BTW. The connection string will take a FQDN (fully qualified domain name) -- if you have the means for DSN
translation. That is if you can successfully ping "mycomputer.mydomain.com" instead of 200.200.200.1,
that'll work too.


pragadheeswaran gopalakrishnan wrote:
> Hi,
>
> I want to know How To Connect  PostgreSQL thru VB throughDSN-less
> connection.
>
> I used the following syntax
> Private Sub ConnectDB
> On Error GoTo EH
> Dim c As New ADODB.Connection
> c.open "DRIVER={PostgreSQL};SERVER=200.200.200.1
> ;port=5432;DATABASE=MyDB;UID=postgres;PWD=postgres;"
> Exit Sub
> EH:
> Msgbox Err.Description,vbcritical,"Error Info"
> End Sub
>
> The  IP address of the machine, where PostgreSQL is installed, is
> 200.200.200.1  which i noted from the Mynetwork places ---> properties --->
> Local Area Connection ---> TCP/IP Internet Protocol properties.
>
> The operating system installed is Win-2000
>
> But , the above code gives error as [Microsoft][ODBC Driver Manager] Data
> Source name not found or default driver not specified.
>
> I guess the value for the SERVER parameter in the above connection string
> code will be wrong. Please guide me.
>
> --
> G.Pragadheeswaran

Attachment

pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1000564 ] Rollback in manual transaction
Next
From: Hiroshi Inoue
Date:
Subject: Re: Most recent driver aborts transaction after one error