Thread: RE: OLE DB access to PostgreSQL

RE: OLE DB access to PostgreSQL

From
Dave Page
Date:

> -----Original Message-----
> From: Paul Swain [mailto:Paul.Swain@cwo.com.au]
> Sent: 26 June 2001 06:54
> To: 'dpage@vale-housing.co.uk'
> Subject: OLE DB access to PostgreSQL
>
>
> Hello Dave,

Hi Paul,

[please direct any future questions to the odbc mailing list so others may
benefit from any answers]

> I have been scanning the Postgres mailing lists for some info
> on using OLE DB connections to connect to a PgSQL database
> from Visual Basic and I am now totally confused.

OK...

> I am trying to write an application that will write to a
> pgSQL db and will be completely portable i.e. it can be run
> on multiple machines without the need for any installation.

It's extremely unlikely that you will be able to do this due to the number
of dependent files the average VB program has.

> The current method I am looking at is using MS OLE DB Simple
> provider to try and write a provider, but I am unsure if this
> is the way to go.

Probably not. That would involve a *serious* amount of work - whilst it
would be possible (and I'm sure there would be other people interested in
the end result), it's not an easy thing to do and would still require either
libpq.dll (which would first need to made to work with VB which is far from
easy otherwise I would have done it long ago), or the ODBC driver. Of course
you could implement the interface directly to the server but that would be
even more work.

> Do you have any suggestions to achieve this end.

As I see it there are 2 options (that don't involve massive amounts of
work).

1) Write your app in C or C++ and statically link it with libpq.lib.

2) Give up on having an install free program, instead, write your app using
VB/ADO/psqlODBC, and write an installer using the Visual Studio Installer or
Wise for Windows Installer etc. to create a scriptable MSI installation
database. This could then be auto-installed/upgraded from a logon script. I
use this method to keep a number of pieces of software up-to-date on a >100
PC network across 8 sites.

HTH,

Regards, Dave.