From: Campbell, Greg <greg.campbell@us.michelin.com>
To: pgsql-odbc@postgresql.org
Subject: Re: How To Connect PostgreSQL thru VB without DSN
Date: Sat, 18 Mar 2006 17:17:45 -0500
Message-ID: <441C8709.2080004@us.michelin.com> (raw)
In-Reply-To: <fc163d500603180526s51e63230u@mail.gmail.com>
References: <fc163d500603180526s51e63230u@mail.gmail.com>
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
Attachments:greg.campbell.vcf (text/x-vcard, 252B) download
begin:vcard
fn:Greg Campbell
n:Campbell;Greg
org:Michelin North America - US5 Lexington;ENG-ASE
email;internet:greg.campbell@us.michelin.com
title:ASE Systems Engineer
tel;work:803-951-5561/x75561
x-mozilla-html:FALSE
version:2.1
end:vcard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: greg.campbell@us.michelin.com
Subject: Re: How To Connect PostgreSQL thru VB without DSN
In-Reply-To: <441C8709.2080004@us.michelin.com>
References: <fc163d500603180526s51e63230u@mail.gmail.com> <441C8709.2080004@us.michelin.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox