Ii can"t connect to postgresql with VFP 8

Ii can"t connect to postgresql with VFP 8

am 04.03.2007 13:55:27 von ionut ichim

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

Re: Ii can"t connect to postgresql with VFP 8

am 06.03.2007 17:04:31 von Andrus

Use

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

""ionut ichim"" wrote in message
news:BAY106-F345418F785C1F0A197B558C0850@phx.gbl...
>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

examples VFP with Postgresql

am 07.03.2007 22:12:51 von ionut ichim

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/


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Re: Ii can"t connect to postgresql with VFP 8

am 08.03.2007 03:31:00 von Luiz

Try :

lnConn =3D SQLSTRINGCONNECT([Driver=3D{PostgreSQL=20
Unicode};Server=3D127.0.0.1;Port=3D5432;Database=3Dpersoane; Uid=3Dpostgre=
s;Pwd=3D123456])=20


Hope this helps


ionut ichim wrote:
> I want to try postgresql with VFP 8 sp1, but i can't connect to new=20
> created database.
> I've installed pq + odbc driver. With pgAdminIII,I can connect to my=20
> database using password '123456' and default user 'postgres',default=20
> 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=20
> database!') :
>
>
> Local lnConn
> lnConn =
> SQLSTRINGCONNECT([Driver=3D{PostgreSQL};Server=3D127.0.0.1;P ort=3D5432;=
Database=3Dpersoane;Uid=3Dpostgres;Pwd=3D123456])=20
>
> If lnConn < 0
> MessageBox( "Couldn't connect to the database !" )
> ELSE
> MessageBox( "OK !" )
> =3DSQLDisconnect( lnConn )
>
> Endif
>
> Thanks !
>
> ____________________________________________________________ _____
> Express yourself instantly with MSN Messenger! Download today it's=20
> 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
>
>

--=20
Luiz K. Matsumura
Plan IT Tecnologia Inform=E1tica Ltda.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: examples VFP with Postgresql

am 08.03.2007 13:26:10 von alejandro.dburne

2007/3/7, ionut ichim :
> 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@postgresql.org so that your
message can get through to the mailing list cleanly

Re: examples VFP with Postgresql

am 08.03.2007 14:02:44 von ionut ichim

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"
>To: pgsql-odbc@postgresql.org
>Subject: Re: [ODBC] examples VFP with Postgresql
>Date: Thu, 8 Mar 2007 09:26:10 -0300
>
>2007/3/7, ionut ichim :
>>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@postgresql.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

Re: examples VFP with Postgresql

am 08.03.2007 14:23:48 von alejandro.dburne

2007/3/8, ionut ichim :
> 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('','','')

b.Run sql statement
lResult=SQLEXEC(_Conn,"SELECT field1, field2... FROM table","")
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

Re: examples VFP with Postgresql

am 08.03.2007 14:38:18 von ionut ichim

ok.. thanks a lot


>From: "Alejandro D. Burne"
>To: pgsql-odbc@postgresql.org
>Subject: Re: [ODBC] examples VFP with Postgresql
>Date: Thu, 8 Mar 2007 10:23:48 -0300
>
>2007/3/8, ionut ichim :
>>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('','','')
>
>b.Run sql statement
>lResult=SQLEXEC(_Conn,"SELECT field1, field2... FROM
>table","")
>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/


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Re: Ii can"t connect to postgresql with VFP 8

am 08.03.2007 14:39:24 von ionut ichim

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



>From: "Luiz K. Matsumura"
>To: ionut ichim
>CC: pgsql-odbc@postgresql.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=p ostgres;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;Por t=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/direc t/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.
>
>
>---------------------------(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/


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: examples VFP with Postgresql

am 08.03.2007 18:19:53 von Andrus

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=<>

@echo <> >backuplog.txt

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

@echo <<"Wait ">>

<> 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"" wrote in message
news:BAY106-F28EC6A8A9B6424BA2CACA5C0790@phx.gbl...
> 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"
>>To: pgsql-odbc@postgresql.org
>>Subject: Re: [ODBC] examples VFP with Postgresql
>>Date: Thu, 8 Mar 2007 09:26:10 -0300
>>
>>2007/3/7, ionut ichim :
>>>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@postgresql.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
>




---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: I can"t connect to postgresql with VFP 8

am 09.03.2007 19:07:43 von ionut ichim

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




>From: "Andrus"
>To: pgsql-odbc@postgresql.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;Pass word=123456])
>
>""ionut ichim"" wrote in message
>news:BAY106-F345418F785C1F0A197B558C0850@phx.gbl...
> >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/


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster