pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ODBC Example with VB5?
5+ messages / 3 participants
[nested] [flat]

* ODBC Example with VB5?
@ 2000-08-17 01:14  Robert Rothe <rrothe@mindspring.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Robert Rothe @ 2000-08-17 01:14 UTC (permalink / raw)
  To: pgsql-interfaces

Can anyone point me to an example of using the postgresql ODBC driver
with Visual Basic 5.0?   I've tried several suggestions from this list,
but still experience read-only errors.  I'm not even sure I'm using the
DAO/RDO/R2D2 calling methods.

I'm currently using the 6.50 version of the ODBC driver.

Thanks for the help.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ODBC Example with VB5?
@ 2000-08-17 02:12  Ashley Clark <aclark@ghoti.org>
  parent: Robert Rothe <rrothe@mindspring.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Ashley Clark @ 2000-08-17 02:12 UTC (permalink / raw)
  To: Robert Rothe <rrothe@mindspring.com>; +Cc: pgsql-interfaces

* Robert Rothe in "[INTERFACES] ODBC Example with VB5?" dated
* 2000/08/16 21:14 wrote:

> Can anyone point me to an example of using the postgresql ODBC driver
> with Visual Basic 5.0?  I've tried several suggestions from this
> list, but still experience read-only errors.  I'm not even sure I'm
> using the DAO/RDO/R2D2 calling methods.

Have you configured your ODBC Data Source correctly?

Under Driver Options, uncheck ReadOnly.
Under Advanced Options, uncheck ReadOnly.

> I'm currently using the 6.50 version of the ODBC driver.

Good luck, it should work out ok.

-- 
shaky caller

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ODBC Example with VB5?
@ 2000-08-17 13:33  Robert Rothe <rrothe@mindspring.com>
  parent: Ashley Clark <aclark@ghoti.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Robert Rothe @ 2000-08-17 13:33 UTC (permalink / raw)
  To: Ashley Clark <aclark@ghoti.org>; +Cc: pgsql-interfaces

I've verified the ODBC configuration options.  I've tried a variety of
combinations -- each of them with R/O off in both the Driver and
Advanced dialogs.

I suspect my problem is more with VB than with Postgres.  Although I did
have a similiar issue when trying to access PG databases via Access.

Do you, or anyone else, have a few lines of code that maybe do this:

a) Open database
b) Read a record set via select into a ListBox
c) Add a record

That would be all I need.  With this working code, I could debug any
ODBC issues better.

Thanks,
Rob


Ashley Clark wrote:
> 
> * Robert Rothe in "[INTERFACES] ODBC Example with VB5?" dated
> * 2000/08/16 21:14 wrote:
> 
> > Can anyone point me to an example of using the postgresql ODBC driver
> > with Visual Basic 5.0?  I've tried several suggestions from this
> > list, but still experience read-only errors.  I'm not even sure I'm
> > using the DAO/RDO/R2D2 calling methods.
> 
> Have you configured your ODBC Data Source correctly?
> 
> Under Driver Options, uncheck ReadOnly.
> Under Advanced Options, uncheck ReadOnly.
> 
> > I'm currently using the 6.50 version of the ODBC driver.
> 
> Good luck, it should work out ok.
> 
> --
> shaky caller
> 
>   ------------------------------------------------------------------------
>    Part 1.2Type: application/pgp-signature



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ODBC Example with VB5?
@ 2000-08-17 15:58  Josh Berkus <josh@agliodbs.com>
  parent: Robert Rothe <rrothe@mindspring.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Josh Berkus @ 2000-08-17 15:58 UTC (permalink / raw)
  To: pgsql-interfaces

Rob,

	I haven't had a reason to connect with Postgres from MS ODBC myself
yet, but I certainly have all the tools.  I'll try something and tell
you how it turns out.

	While I'm here, can any one give me input as to pros/cons on using
phpDB vs. php-postgres to connect with Postgres from a PHP4 web site?

					-Josh Berkus
-- 
______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology      josh@agliodbs.com
    and data management solutions       (415) 436-9166
   for law firms, small businesses       fax  436-0137
    and non-profit organizations.       pager 338-4078
                        		San Francisco



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ODBC Example with VB5?
@ 2000-08-18 00:49  Robert Rothe <rrothe@mindspring.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Robert Rothe @ 2000-08-18 00:49 UTC (permalink / raw)
  To: Sean Alphonse <salphonse1@home.com>; pgsql-interfaces

Well, it appears that updating the MDAC was a big part of the problem.  Thanks
to everyone who provided suggestions.

I did get everything to work under VB5.  For those interested, here is the
simple code used to test.  In VB, create one form with one list box "List1".
The following code goes into the form's load event.   There is no need to setup
a DSN using this method, although you can by specifying "DSN","USER","PWD" on
the conn1.open line.


Private Sub Form_Load()

Dim conn1 As New ADODB.Connection
Dim cmd1 As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim AccessConnect As String

AccessConnect =
"driver={PostgreSQL};server=192.168.1.59;database=testdata;uid=youruser;pwd=;"
conn1.ConnectionString = AccessConnect
conn1.Open

 cmd1.ActiveConnection = conn1
 cmd1.CommandText = "Select * from users order by userid"
 Set rs = cmd1.Execute

While Not rs.EOF

    ' Null fields cause this to crash and burn, so use some logic...

    List1.AddItem rs("userid") + rs("lastn")
    rs.MoveNext
Wend

'If you have unique keys, this will obviously only work once

cmd1.CommandText = "insert into users (userid,password,lastn) values
('xxxxxxx1','xxxxxxx2','Lastxxx')"
cmd1.Execute


End Sub


_~_~_~_~_~__~~__~_~~__~_~_~


Sean Alphonse wrote:

> Hello.
> I have worked with VB6 and Postgresql. One of the problems that I ran into
> was with me having to install MDAC 2.5 and another problem was with
> correctly configuring the pg_hba.conf file to allow remote machines to
> connect to PostgreSQL. Have you looked at these options?
>
> Sean.
>
> -----Original Message-----
> From: pgsql-interfaces-owner@hub.org
> [mailto:pgsql-interfaces-owner@hub.org]On Behalf Of Robert Rothe
> Sent: Thursday, August 17, 2000 8:34 AM
> To: Ashley Clark
> Cc: pgsql-interfaces@postgresql.org
> Subject: Re: [INTERFACES] ODBC Example with VB5?
>
> I've verified the ODBC configuration options.  I've tried a variety of
> combinations -- each of them with R/O off in both the Driver and
> Advanced dialogs.
>
> I suspect my problem is more with VB than with Postgres.  Although I did
> have a similiar issue when trying to access PG databases via Access.
>
> Do you, or anyone else, have a few lines of code that maybe do this:
>
> a) Open database
> b) Read a record set via select into a ListBox
> c) Add a record
>
> That would be all I need.  With this working code, I could debug any
> ODBC issues better.
>
> Thanks,
> Rob
>
> Ashley Clark wrote:
> >
> > * Robert Rothe in "[INTERFACES] ODBC Example with VB5?" dated
> > * 2000/08/16 21:14 wrote:
> >
> > > Can anyone point me to an example of using the postgresql ODBC driver
> > > with Visual Basic 5.0?  I've tried several suggestions from this
> > > list, but still experience read-only errors.  I'm not even sure I'm
> > > using the DAO/RDO/R2D2 calling methods.
> >
> > Have you configured your ODBC Data Source correctly?
> >
> > Under Driver Options, uncheck ReadOnly.
> > Under Advanced Options, uncheck ReadOnly.
> >
> > > I'm currently using the 6.50 version of the ODBC driver.
> >
> > Good luck, it should work out ok.
> >
> > --
> > shaky caller
> >
> >   ------------------------------------------------------------------------
> >    Part 1.2Type: application/pgp-signature




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2000-08-18 00:49 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-08-17 01:14 ODBC Example with VB5? Robert Rothe <rrothe@mindspring.com>
2000-08-17 02:12 ` Ashley Clark <aclark@ghoti.org>
2000-08-17 13:33   ` Robert Rothe <rrothe@mindspring.com>
2000-08-17 15:58     ` Josh Berkus <josh@agliodbs.com>
2000-08-18 00:49 Re: ODBC Example with VB5? Robert Rothe <rrothe@mindspring.com>

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