Skip site navigation (1) Skip section navigation (2)

How To Connect PostgreSQL thru VB without DSN

From: "pragadheeswaran gopalakrishnan" <pragadheeswaran(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: How To Connect PostgreSQL thru VB without DSN
Date: 2006-03-18 13:26:52
Message-ID: fc163d500603180526s51e63230u@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-odbc
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

Responses

pgsql-odbc by date

Next:From: noreplyDate: 2006-03-18 17:26:23
Subject: [ psqlodbc-Bugs-1000589 ] data source configuration dialog page switching bugs
Previous:From: Bart SamwelDate: 2006-03-18 11:09:05
Subject: Re: Most recent driver aborts transaction after one error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group