Re: examples VFP with Postgresql

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
Thread:
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
>

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message David Gardner 2007-03-08 17:43:51 Re: Access violation - probably not the fault of Postgres
Previous Message Brodie Thiesfield 2007-03-08 14:06:00 BLOB via ODBC