From: | "Campbell, Greg" <greg(dot)campbell(at)us(dot)michelin(dot)com> |
---|---|
To: | pgsql-odbc(at)postgresql(dot)org |
Subject: | Re: How To Connect PostgreSQL thru VB without DSN |
Date: | 2006-03-18 22:17:45 |
Message-ID: | 441C8709.2080004@us.michelin.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 | Content-Type | Size |
---|---|---|
greg.campbell.vcf | text/x-vcard | 251 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Hiroshi Inoue | 2006-03-18 23:20:37 | Re: Most recent driver aborts transaction after one error |
Previous Message | noreply | 2006-03-18 22:01:33 | [ psqlodbc-Bugs-1000564 ] Rollback in manual transaction |