Re: examples VFP with Postgresql

Lists: pgsql-odbc
From: "ionut ichim" <ionutichim(at)hotmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Ii can't connect to postgresql with VFP 8
Date: 2007-03-04 12:55:27
Message-ID: BAY106-F345418F785C1F0A197B558C0850@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

I want to try postgresql with VFP 8 sp1, but i can't connect to new created
database.
I've installed pq + odbc driver. With pgAdminIII,I can connect to my
database using password '123456' and default user 'postgres',default port
5432 ,but with VFP i can't.Connection is a local one
This is the code I use (it always gives me 'Couldn't connect to the
database!') :

Local lnConn
lnConn =
SQLSTRINGCONNECT([Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])
If lnConn < 0
MessageBox( "Couldn't connect to the database !" )
ELSE
MessageBox( "OK !" )
=SQLDisconnect( lnConn )

Endif

Thanks !

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Ii can't connect to postgresql with VFP 8
Date: 2007-03-06 16:04:31
Message-ID: esk3ge$tg7$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

Use

SQLSTRINGCONNECT([Driver=PostgreSQL
Unicode;Host=127.0.0.1;Database=persoane;User=postgres;Password=123456])

""ionut ichim"" <ionutichim(at)hotmail(dot)com> wrote in message
news:BAY106-F345418F785C1F0A197B558C0850(at)phx(dot)gbl(dot)(dot)(dot)
>I want to try postgresql with VFP 8 sp1, but i can't connect to new created
>database.
> I've installed pq + odbc driver. With pgAdminIII,I can connect to my
> database using password '123456' and default user 'postgres',default port
> 5432 ,but with VFP i can't.Connection is a local one
> This is the code I use (it always gives me 'Couldn't connect to the
> database!') :
>
>
> Local lnConn
> lnConn =
> SQLSTRINGCONNECT([Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])
> If lnConn < 0
> MessageBox( "Couldn't connect to the database !" )
> ELSE
> MessageBox( "OK !" )
> =SQLDisconnect( lnConn )
>
> Endif
>
> Thanks !
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>


From: "ionut ichim" <ionutichim(at)hotmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: examples VFP with Postgresql
Date: 2007-03-07 21:12:51
Message-ID: BAY106-F33B8DC7C43B21CC105D567C07A0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

I'm looking for some examples VFP with Postgresql ?
thanks.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From: "Luiz K(dot) Matsumura" <luiz(at)planit(dot)com(dot)br>
To: ionut ichim <ionutichim(at)hotmail(dot)com>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Ii can't connect to postgresql with VFP 8
Date: 2007-03-08 02:31:00
Message-ID: 45EF7564.9020502@planit.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

Try :

lnConn = SQLSTRINGCONNECT([Driver={PostgreSQL
Unicode};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])

Hope this helps

ionut ichim wrote:
> I want to try postgresql with VFP 8 sp1, but i can't connect to new
> created database.
> I've installed pq + odbc driver. With pgAdminIII,I can connect to my
> database using password '123456' and default user 'postgres',default
> port 5432 ,but with VFP i can't.Connection is a local one
> This is the code I use (it always gives me 'Couldn't connect to the
> database!') :
>
>
> Local lnConn
> lnConn =
> SQLSTRINGCONNECT([Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])
>
> If lnConn < 0
> MessageBox( "Couldn't connect to the database !" )
> ELSE
> MessageBox( "OK !" )
> =SQLDisconnect( lnConn )
>
> Endif
>
> Thanks !
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's
> FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>

--
Luiz K. Matsumura
Plan IT Tecnologia Informática Ltda.


From: "Alejandro D(dot) Burne" <alejandro(dot)dburne(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: examples VFP with Postgresql
Date: 2007-03-08 12:26:10
Message-ID: 8398dc6d0703080426hc9907det376df423e8756a23@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

2007/3/7, ionut ichim <ionutichim(at)hotmail(dot)com>:
> I'm looking for some examples VFP with Postgresql ?
> thanks.

I'm using vfp with postgresql, what kind of examples?

Alejandro


From: "ionut ichim" <ionutichim(at)hotmail(dot)com>
To: alejandro(dot)dburne(at)gmail(dot)com, pgsql-odbc(at)postgresql(dot)org
Subject: Re: examples VFP with Postgresql
Date: 2007-03-08 13:02:44
Message-ID: BAY106-F28EC6A8A9B6424BA2CACA5C0790@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

Thanks for answer.
I'm interest how can i work with pg +VFP ... connections,sored
procedures,backup ,etc
Some links for simple examples, to test.

>From: "Alejandro D. Burne" <alejandro(dot)dburne(at)gmail(dot)com>
>To: pgsql-odbc(at)postgresql(dot)org
>Subject: Re: [ODBC] examples VFP with Postgresql
>Date: Thu, 8 Mar 2007 09:26:10 -0300
>
>2007/3/7, ionut ichim <ionutichim(at)hotmail(dot)com>:
>>I'm looking for some examples VFP with Postgresql ?
>>thanks.
>
>I'm using vfp with postgresql, what kind of examples?
>
>Alejandro
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From: "Alejandro D(dot) Burne" <alejandro(dot)dburne(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: examples VFP with Postgresql
Date: 2007-03-08 13:23:48
Message-ID: 8398dc6d0703080523u458ab8dcw9ea6626ca3feb84a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

2007/3/8, ionut ichim <ionutichim(at)hotmail(dot)com>:
> Thanks for answer.
> I'm interest how can i work with pg +VFP ... connections,sored
> procedures,backup ,etc
> Some links for simple examples, to test.

First at all I'm using sqlpassthrough:

a.Create connection:
_Conn=SQLCONNECT('<ODBC Conn>','<user>','<pwd>')

b.Run sql statement
lResult=SQLEXEC(_Conn,"SELECT field1, field2... FROM table","<cursor_name>")
IF lResult>0
* all goes fine
ELSE
MESSAGEBOX(MESSAGE())
ENDIF

c.Disconnect
lResult=SQLDISCONNECT(_Conn)

Stores procedures, functions is like any other sql statement using psql.
Backups -> RTFunnyM

Alejandro


From: "ionut ichim" <ionutichim(at)hotmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: examples VFP with Postgresql
Date: 2007-03-08 13:38:18
Message-ID: BAY106-F1652B3A6DAE74D277AE136C0790@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

ok.. thanks a lot

>From: "Alejandro D. Burne" <alejandro(dot)dburne(at)gmail(dot)com>
>To: pgsql-odbc(at)postgresql(dot)org
>Subject: Re: [ODBC] examples VFP with Postgresql
>Date: Thu, 8 Mar 2007 10:23:48 -0300
>
>2007/3/8, ionut ichim <ionutichim(at)hotmail(dot)com>:
>>Thanks for answer.
>>I'm interest how can i work with pg +VFP ... connections,sored
>>procedures,backup ,etc
>> Some links for simple examples, to test.
>
>First at all I'm using sqlpassthrough:
>
>a.Create connection:
>_Conn=SQLCONNECT('<ODBC Conn>','<user>','<pwd>')
>
>b.Run sql statement
>lResult=SQLEXEC(_Conn,"SELECT field1, field2... FROM
>table","<cursor_name>")
>IF lResult>0
> * all goes fine
>ELSE
> MESSAGEBOX(MESSAGE())
>ENDIF
>
>c.Disconnect
>lResult=SQLDISCONNECT(_Conn)
>
>Stores procedures, functions is like any other sql statement using psql.
>Backups -> RTFunnyM
>
>Alejandro
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: don't forget to increase your free space map settings

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From: "ionut ichim" <ionutichim(at)hotmail(dot)com>
To: luiz(at)planit(dot)com(dot)br, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Ii can't connect to postgresql with VFP 8
Date: 2007-03-08 13:39:24
Message-ID: BAY106-F2086D41FD62710DEA57A18C0790@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc


ok..i'll try it. Thanks very much!

>From: "Luiz K. Matsumura" <luiz(at)planit(dot)com(dot)br>
>To: ionut ichim <ionutichim(at)hotmail(dot)com>
>CC: pgsql-odbc(at)postgresql(dot)org
>Subject: Re: [ODBC] Ii can't connect to postgresql with VFP 8
>Date: Wed, 07 Mar 2007 23:31:00 -0300
>
>Try :
>
>lnConn = SQLSTRINGCONNECT([Driver={PostgreSQL
>Unicode};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])
>
>
>Hope this helps
>
>
>ionut ichim wrote:
>>I want to try postgresql with VFP 8 sp1, but i can't connect to new
>>created database.
>>I've installed pq + odbc driver. With pgAdminIII,I can connect to my
>>database using password '123456' and default user 'postgres',default port
>>5432 ,but with VFP i can't.Connection is a local one
>>This is the code I use (it always gives me 'Couldn't connect to the
>>database!') :
>>
>>
>>Local lnConn
>>lnConn =
>>SQLSTRINGCONNECT([Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])
>>
>>If lnConn < 0
>> MessageBox( "Couldn't connect to the database !" )
>>ELSE
>> MessageBox( "OK !" )
>> =SQLDisconnect( lnConn )
>>
>>Endif
>>
>>Thanks !
>>
>>_________________________________________________________________
>>Express yourself instantly with MSN Messenger! Download today it's FREE!
>>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Have you searched our list archives?
>>
>> http://archives.postgresql.org
>>
>>
>
>--
>Luiz K. Matsumura
>Plan IT Tecnologia Informtica Ltda.
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: Don't 'kill -9' the postmaster

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: examples VFP with Postgresql
Date: 2007-03-08 17:19:53
Message-ID: espgk3$2r89$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

For backup, use

LPARAMETERS cFn, cserver,cuser,nport,cdatabase

* Using Ed Rauh class available from Universal thread downloads

LOCAL orun as api_apprun OF api_apprun.vcx

EXTERNAL CLASS api_apprun.vcx

LOCAL cAppl

cAppl= 'pg_dump.exe'

LOCAL cmdline

cmdline = '"'+m.cAppl + [" -ibv -Z3 -f "]+m.cFn+ ;

[" -Fc -h ]+cserver+ ;

[ -U ]+user+ ;

[ -p ]+TRANSFORM(nPort)+ ;

' '+ cdatabase

text to lcBatText textmerge noshow

@echo off

@set pgpassword=<<this.cpassword>>

@echo <<cmdline>> >backuplog.txt

@echo <<"Creating backup "+m.cFN>>

@echo <<"Wait ">>

<<cmdline>> 2>>backuplog.txt

echo %errorlevel% >errorlevel.txt

ENDTEXT

lcHere=fullpath(set("directory"))

lcBat=fullpath("tmp.bat")

strtofile(lcBatText, lcBat)

orun=Newobject('api_apprun','api_apprun.vcx', '', lcbat, lcHere)

IF !orun.launchappandwait()

messagebox( m.cAppl + ' ; ' + ;

"Cannot run" )

DELETE FILE (lcbat)

DELETE FILE backuplog.txt

DELETE FILE errorlevel.txt

RETURN .f.

ENDIF

IF orun.CheckProcessexitcode()#0

DELETE FILE (m.cFN)

messagebox( +' Backup process error ; '+ ;

TRANSFORM(orun.checkprocessexitcode(),'@0' ) )

MODIFY FILE backuplog.txt

DELETE FILE backuplog.txt

DELETE FILE errorlevel.txt

DELETE FILE (lcbat)

RETURN .f.

ENDIF

nErrorLevel=val(filetostr("errorlevel.txt"))

IF nErrorLevel#0

DELETE FILE (m.cFN)

okget( " pgdup error code " + ;

filetostr("errorlevel.txt"), m.cFN, .t. )

MODIFY FILE backuplog.txt

DELETE FILE backuplog.txt

DELETE FILE errorlevel.txt

DELETE FILE (lcbat)

RETURN .f.

ENDIF

DELETE FILE (lcbat)

IF !file(m.cFN)

MODIFY FILE backuplog.txt

DELETE FILE backuplog.txt

DELETE FILE errorlevel.txt

RETURN .f.

ENDIF

""ionut ichim"" <ionutichim(at)hotmail(dot)com> wrote in message
news:BAY106-F28EC6A8A9B6424BA2CACA5C0790(at)phx(dot)gbl(dot)(dot)(dot)
> Thanks for answer.
> I'm interest how can i work with pg +VFP ... connections,sored
> procedures,backup ,etc
> Some links for simple examples, to test.
>
>
>
>
>
>>From: "Alejandro D. Burne" <alejandro(dot)dburne(at)gmail(dot)com>
>>To: pgsql-odbc(at)postgresql(dot)org
>>Subject: Re: [ODBC] examples VFP with Postgresql
>>Date: Thu, 8 Mar 2007 09:26:10 -0300
>>
>>2007/3/7, ionut ichim <ionutichim(at)hotmail(dot)com>:
>>>I'm looking for some examples VFP with Postgresql ?
>>>thanks.
>>
>>I'm using vfp with postgresql, what kind of examples?
>>
>>Alejandro
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 1: if posting/reading through Usenet, please send an appropriate
>> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>> message can get through to the mailing list cleanly
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>


From: "ionut ichim" <ionutichim(at)hotmail(dot)com>
To: kobruleht2(at)hot(dot)ee, pgsql-odbc(at)postgresql(dot)org, luiz(at)planit(dot)com(dot)br
Subject: Re: I can't connect to postgresql with VFP 8
Date: 2007-03-09 18:07:43
Message-ID: BAY106-F26234033EA464EC3F5FCEBC0780@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-odbc

With your suggestion works,thanks !
Thanks to Luiz K. Matsumura.

>From: "Andrus" <kobruleht2(at)hot(dot)ee>
>To: pgsql-odbc(at)postgresql(dot)org
>Subject: Re: [ODBC] Ii can't connect to postgresql with VFP 8
>Date: Tue, 6 Mar 2007 18:04:31 +0200
>
>Use
>
> SQLSTRINGCONNECT([Driver=PostgreSQL
>Unicode;Host=127.0.0.1;Database=persoane;User=postgres;Password=123456])
>
>""ionut ichim"" <ionutichim(at)hotmail(dot)com> wrote in message
>news:BAY106-F345418F785C1F0A197B558C0850(at)phx(dot)gbl(dot)(dot)(dot)
> >I want to try postgresql with VFP 8 sp1, but i can't connect to new
>created
> >database.
> > I've installed pq + odbc driver. With pgAdminIII,I can connect to my
> > database using password '123456' and default user 'postgres',default
>port
> > 5432 ,but with VFP i can't.Connection is a local one
> > This is the code I use (it always gives me 'Couldn't connect to the
> > database!') :
> >
> >
> > Local lnConn
> > lnConn =
> >
>SQLSTRINGCONNECT([Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=persoane;Uid=postgres;Pwd=123456])
> > If lnConn < 0
> > MessageBox( "Couldn't connect to the database !" )
> > ELSE
> > MessageBox( "OK !" )
> > =SQLDisconnect( lnConn )
> >
> > Endif
> >
> > Thanks !
> >
> > _________________________________________________________________
> > Express yourself instantly with MSN Messenger! Download today it's FREE!
> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/