pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
(no subject)
5+ messages / 4 participants
[nested] [flat]

* (no subject)
@ 2000-12-09 14:57 Aziz ABI <abi@mail.cbi.net.ma>
  2000-12-13 04:09 ` Re: your mail Bob Kline <bkline@rksystems.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Aziz ABI @ 2000-12-09 14:57 UTC (permalink / raw)
  To: pgsql-interfaces

Bonjour

Vous pouvez m'aider à créer une connexion ODBC à partir par un petit module VB.

Merci

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

* Re: your mail
  2000-12-09 14:57 (no subject) Aziz ABI <abi@mail.cbi.net.ma>
@ 2000-12-13 04:09 ` Bob Kline <bkline@rksystems.com>
  2000-12-13 13:46   ` Re: Re: your mail Adam Lang <aalang@rutgersinsurance.com>
  2000-12-13 17:05   ` passwd Katsuyuki Tanaka <katsut@cse.unsw.edu.au>
  0 siblings, 2 replies; 5+ messages in thread

From: Bob Kline @ 2000-12-13 04:09 UTC (permalink / raw)
  To: Aziz ABI <abi@mail.cbi.net.ma>; +Cc: pgsql-interfaces

On Sat, 9 Dec 2000, Aziz ABI wrote:

> Bonjour
> 
> Vous pouvez m'aider à créer une connexion ODBC à partir par un petit
> module VB.
> 
> Merci
> 

Sure.

1. Set your pg_hba.conf to allow access from your Windows machine.
2. Install the ODBC driver for PostgreSQL on that machine.
3. Set up an ODBC DSN using that driver.
4. Here's some sample VB code to talk to the database using the DSN:

    Dim rs As ADODB.Recordset
    Dim cn As String
    Dim rc As Variant
    Dim r, c As Integer
    Set rs = New ADODB.Recordset
    cn = "DSN=pgtest;UID=moi;DATABASE=test"
    rs.Open "SELECT * FROM t", cn, , , 1
    Do While Not rs.EOF
        rc = rs.GetRows
        For r = 0 To UBound(rc, 2)
            For c = 0 To UBound(rc, 1)
                Debug.Print r & " " & c " " & rc(c, r)
            Next c
        Next r
    Loop

Hope this help.

-- 
Bob Kline 
mailto:bkline@rksystems.com 
http://www.rksystems.com




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

* Re: Re: your mail
  2000-12-09 14:57 (no subject) Aziz ABI <abi@mail.cbi.net.ma>
  2000-12-13 04:09 ` Re: your mail Bob Kline <bkline@rksystems.com>
@ 2000-12-13 13:46   ` Adam Lang <aalang@rutgersinsurance.com>
  2000-12-13 15:32     ` Re: Re: your mail Bob Kline <bkline@rksystems.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Adam Lang @ 2000-12-13 13:46 UTC (permalink / raw)
  To: ; +Cc: pgsql-interfaces

For curiosity's sake... why are you using getrows?

Much easier to do:

dim fd as ADODB.Recordset
dim strRow as string
do while not rs.EOF
    strRow = ""
    for each fd in rs.Fields
        strRow = strRow & " " & fd.value
    next
    debug.Print strRow
    rs.MoveNext
Loop
set fd = nothing

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Bob Kline" <bkline@rksystems.com>
To: "Aziz ABI" <abi@mail.cbi.net.ma>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Tuesday, December 12, 2000 11:09 PM
Subject: [INTERFACES] Re: your mail


> On Sat, 9 Dec 2000, Aziz ABI wrote:
>
> > Bonjour
> >
> > Vous pouvez m'aider à créer une connexion ODBC à partir par un petit
> > module VB.
> >
> > Merci
> >
>
> Sure.
>
> 1. Set your pg_hba.conf to allow access from your Windows machine.
> 2. Install the ODBC driver for PostgreSQL on that machine.
> 3. Set up an ODBC DSN using that driver.
> 4. Here's some sample VB code to talk to the database using the DSN:
>
>     Dim rs As ADODB.Recordset
>     Dim cn As String
>     Dim rc As Variant
>     Dim r, c As Integer
>     Set rs = New ADODB.Recordset
>     cn = "DSN=pgtest;UID=moi;DATABASE=test"
>     rs.Open "SELECT * FROM t", cn, , , 1
>     Do While Not rs.EOF
>         rc = rs.GetRows
>         For r = 0 To UBound(rc, 2)
>             For c = 0 To UBound(rc, 1)
>                 Debug.Print r & " " & c " " & rc(c, r)
>             Next c
>         Next r
>     Loop
>
> Hope this help.
>
> --
> Bob Kline
> mailto:bkline@rksystems.com
> http://www.rksystems.com




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

* Re: Re: your mail
  2000-12-09 14:57 (no subject) Aziz ABI <abi@mail.cbi.net.ma>
  2000-12-13 04:09 ` Re: your mail Bob Kline <bkline@rksystems.com>
  2000-12-13 13:46   ` Re: Re: your mail Adam Lang <aalang@rutgersinsurance.com>
@ 2000-12-13 15:32     ` Bob Kline <bkline@rksystems.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Bob Kline @ 2000-12-13 15:32 UTC (permalink / raw)
  To: Adam Lang <aalang@rutgersinsurance.com>; +Cc: pgsql-interfaces

On Wed, 13 Dec 2000, Adam Lang wrote:

> For curiosity's sake... why are you using getrows?
> 
> Much easier to do:
> 
> dim fd as ADODB.Recordset
> dim strRow as string
> do while not rs.EOF
>     strRow = ""
>     for each fd in rs.Fields
>         strRow = strRow & " " & fd.value
>     next
>     debug.Print strRow
>     rs.MoveNext
> Loop
> set fd = nothing

Sure, that works, too.  All I was trying to illustrate was how he could
establish the connection, which is what he originally asked.  Turns out
that's not what he meant, though.  What he really wanted to know was how
to create the data source programmatically.

-- 
Bob Kline
mailto:bkline@rksystems.com
http://www.rksystems.com




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

* passwd
  2000-12-09 14:57 (no subject) Aziz ABI <abi@mail.cbi.net.ma>
  2000-12-13 04:09 ` Re: your mail Bob Kline <bkline@rksystems.com>
@ 2000-12-13 17:05   ` Katsuyuki Tanaka <katsut@cse.unsw.edu.au>
  1 sibling, 0 replies; 5+ messages in thread

From: Katsuyuki Tanaka @ 2000-12-13 17:05 UTC (permalink / raw)
  To: pgsql-interfaces



	Can anyone tell me how to set passwd for users? I do
	what I told in pg_passwd man it doesn;t seem to work.
	eg, when I do 
		psql -u testdb
		UserName: user
		password: ....

	anything i type in password let user access testdb,
	I beilive that this username and password are what we have to
	put in jdbc getConnection? Am I right?

	one more question if one user create db is this accessable from 
	other users? Seem to me it si now since my authentification is not
	working .....

	Thanks
	Katsu




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


end of thread, other threads:[~2000-12-13 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-09 14:57  Aziz ABI <abi@mail.cbi.net.ma>
2000-12-13 04:09 ` Re: your mail Bob Kline <bkline@rksystems.com>
2000-12-13 13:46   ` Re: Re: your mail Adam Lang <aalang@rutgersinsurance.com>
2000-12-13 15:32     ` Re: Re: your mail Bob Kline <bkline@rksystems.com>
2000-12-13 17:05   ` passwd Katsuyuki Tanaka <katsut@cse.unsw.edu.au>

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