Hi, I have just downloaded PostgreSQL and would like to add it into my new projects. I have never used PostgreSQL before so I don't know any of its technical details yet. I have registered the PostgreSQL provider using regsvr32 pgoledb.dll or something like that on my Winows partition, everything registered successfully according to a pop-up message, and I went into Delphi and saw that it now shows PostgreSQL under the provider list.

I tried to use it with an TADOQuery but after I wanted to test the connection, I got the following error: "Test connection failed because of an error in initializing provider. Unspecified error." Now I'm confused... Is it because PostgreSQL 9 is too new for the PostgreSQL OLE DB Provider? Or did I just to something wrong?

In the connection string, I assumed that the Data Source field is the Server or Database name, Location is the Port, Username is the same as in PostgreSQL, as well as the password... Or will it be better to connect via code?

Any help will be greatly appreciated

I found this in readme file of the provider :
PgOleDb supports the following connection attributes:
Provider - mandatory. Must be set to "PostgreSQL", "PostgreSQL.1" or "PostgreSQL OLE DB Provider"
Data Source - server name or address
location - database name
User ID - PG user name to log in as
password - the password
timeout - how long to wait when establishing the initial connection

Hi thanks for the reply, now I know how it works and will start to investigate the readme file more often. But when I try to connect with Data Source as the server name or location I get the following error: 'Could not translate host name "PostgreSQL 9.0" to address: Unknown host' I tried PostgreSQL 9.0, localhost, 5432, localhost:5432 and even PostgreSQL 9.0 (localhost:5432). Where can I find the correct Server name??

Thanks!

server name is localhost. I installed Postgre and I got the same error before I put the correct password. I used the following connection parameters:
Data source : localhost
Location : postgre
user : postgre
password : admin --> the password I wrote at installation time.

Hope this helps
Ionut

Thank you for your help, Ionelul! My problem is one of the past =D... It turned out to be only the localhost for data source as you suggested... SOLVED

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.