Re: How To Connect PostgreSQL thru VB without DSN

From: "Jamal Mazrui" <Jamal(dot)Mazrui(at)fcc(dot)gov>
To: "pragadheeswaran gopalakrishnan" <pragadheeswaran(at)gmail(dot)com>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: How To Connect PostgreSQL thru VB without DSN
Date: 2006-03-20 15:59:51
Message-ID: A79D3F903121D240A2F7580DF0272F6C021FCD9F@P2PXMB07.fccnet.win.fcc.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-odbc-owner(at)postgresql(dot)org] On Behalf Of pragadheeswaran
gopalakrishnan
Sent: Saturday, March 18, 2006 8:27 AM
To: pgsql-odbc(at)postgresql(dot)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

Browse pgsql-odbc by date

  From Date Subject
Next Message Johann 2006-03-20 17:13:05 newline in varchar causing funny behavior?
Previous Message Dave Page 2006-03-20 15:19:31 Future versions of psqlODBC