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

From Jamal Mazrui
Subject Re: How To Connect PostgreSQL thru VB without DSN
Date
Msg-id A79D3F903121D240A2F7580DF0272F6C021FCD9F@P2PXMB07.fccnet.win.fcc.gov
Whole thread Raw
In response to How To Connect PostgreSQL thru VB without DSN  ("pragadheeswaran gopalakrishnan" <pragadheeswaran@gmail.com>)
List pgsql-odbc
For the driver name in the connect string, try {PostgreSQL ANSI} or {PostgreSQL Unicode}, instead of just {PostgreSQL}.  I noticed that the Windows ODBC administrator inserted this for the driver name.  Unfortunately, the new driver name was not documented in any of the PostgreSQL documentation I found on ODBC, so it took me hours to debug this problem.
 
Regards,
Jamal
 
 
-----Original Message-----
From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of pragadheeswaran gopalakrishnan
Sent: Saturday, March 18, 2006 8:27 AM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] How To Connect PostgreSQL thru VB without DSN

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

pgsql-odbc by date:

Previous
From: "Dave Page"
Date:
Subject: Future versions of psqlODBC
Next
From: "Johann"
Date:
Subject: newline in varchar causing funny behavior?