I just did a test to see if the PGDBE could be an option.
I have the following test program, as you can find in the docs.
Code: Select all
#include "Common.ch"
// PostgresSQL DBE header file is required
#include "pgdbe.ch"
PROCEDURE Main
LOCAL cConnect
LOCAL oSession
// Load the PostgreSQL DatabaseEngine
IF(!DbeLoad("pgdbe"))
Alert( "Unable to load the PostgreSQL DatabaseEngine", {"Quit"} )
QUIT
ENDIF
// Establish the connection
cConnect := "DBE=pgdbe;SERVER=localhost;DB=northwind;UID=postgres;PWD=aboservice"
oSession := DacSession():New( cConnect )
// Check for connection success
IF .NOT. oSession:isConnected()
? oSession:GetLastMessage()
Alert( "Unable to establish connection to server", {"Quit"} )
QUIT
ENDIF
// Perform simple select and browse
// the result set
SELECT * FROM customers VIA (oSession) // IMPORTANT oSession MUST be between ( ) !!!!
Browse()
// Up to here it is working.
alert("Use and show name of first record")
use customers alias klant via PGDBE
klant->(dbgoto(1))
alert( klant->companyname )
// Disconnect from server
oSession:disconnect()
RETURN
After the dbgotop of dbgoto(1), the klant->companyname remains empty.
Anyone an idea what's wrong with this?