Thread: visual basic

visual basic

From
Date:
i need to get visual basic and my postgresql database interacting, i've really just started with postsql so if anyone can help me it would be much appreciated. I'm running vb6. Please reply

Re: visual basic

From
Jeff Eckermann
Date:
--- james@digconn.co.uk wrote:
> i need to get visual basic and my postgresql
> database interacting, i've really just started with
> postsql so if anyone can help me it would be much
> appreciated. I'm running vb6. Please reply

http://gborg.postgresql.org/project/psqlodbc

As well as the ODBC driver, you will also find code
examples which will get you started.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: visual basic

From
Andrew Ayers
Date:
james@digconn.co.uk wrote:
> i need to get visual basic and my postgresql database interacting, i've
> really just started with postsql so if anyone can help me it would be
> much appreciated. I'm running vb6. Please reply

I have posted many messages and gotten replies relating to my issues
that I had with getting VB6 and PostgreSQL communnicating. You should be
able to find the postings in the archives for both the ODBC and GENERAL
mailing lists (look from March of this year onward).

Basically, you will need to use ODBC (I suppose it might be possible to
also use whatever interface lib DLL exists for Windows, with custom VB
declarations to the functions, if your VB code and PG are living on a
Windows server), so you will need to obtain the ODBC driver:

http://gborg.postgresql.org/project/psqlodbc/projdisplay.php

Once you have that set up, you will need to decide on whether you want a
DSN or DSN-less connection. Both have pros and cons, depending on what
you are trying to do. Typically, DSN connections are best when you only
have the application on a single machine, like a web application.
DSN-less are best where you are distributing the app in a multi-tier
fashion, such as if the app is a VB application on multiple clients,
where you aren't physically able, or it isn't practical to set up a
bunch of DSN names.

Then, set things up in your VB app like you would if you were using an
Access DB - you will need to select either DAO or ADO. If you read my
messages, you will find that I had particular trouble with DAO, and
changed my code over to use ADO. I reccommend that you do the same. I
don't know anything about RDO - in theory it could work, but I have
never tried it.

 From there it should be easy. Now, I have left out a bunch of stuff
that I am not familiar with (like how you set up the database and such).
If you are saddled with that task, others here or on other lists can
probably help you. But I was able to quickly and easily get VB
communicating and updating a PG database.

I recently posted (September 8) to the ODBC list a very quick rundown of
what I am using, with sample code. It would probably help to get you
started. It isn't meant to be a complete and thorough tutorial. But it
should get you moving in the proper direction.

Good luck,

Andrew Ayers
Phoenix, Arizona

-- CONFIDENTIALITY NOTICE --

This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain
informationthat is privileged, confidential and exempt from disclosure under applicable law. If you are not the
intendedaddressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use,
copy,disclose or distribute to anyone the message or any information contained in the message. If you have received
thismessage in error, please immediately advise the sender by reply email, and delete the message. Thank you.