DCBROWSE and ACEWrappers
Posted: Thu Jun 14, 2018 9:04 am
Hi,
I want examine use ADL to use DBF/CDX files via it, but some problems I have with it.
Open table is correct, however when I want open dbf table, which have CDX file present in directory and I write use table1 alias "T1" , this not open, and I must delete index file.
ok, I can do it
When after open table I want show record, for example
Dc_msgbox((cAlias2)->VLA)
where VLA is one from fields, this also works
but when want browse table, I examined many entries, but any not work, every time error invalid symbol/alias error.
Note : In ACE_UDF I have defined
//
#xtranslate VL836915-><f> => FieldWGet("VL836915",<"f">)
#xtranslate VL836915-><f> == <x> => FieldWGet("VL836915",<"f">) == <x>
...etc
where I use for alias same name as file DBF.
What can be here wrong ?
#INCLUDE "ACE_UDF.CH"
#INCLUDE "XBP.CH"
#include "dll.ch"
#include "common.ch"
#include "font.ch"
#INCLUDE "ACE.CH"
*#INCLUDE "SQL.CH"
*#INCLUDE "SQLEXT.CH"
#INCLUDE "INKEY.CH"
#INCLUDE "dcdialog.CH"
#INCLUDE "gra.CH"
#INCLUDE "appevent.CH"
#INCLUDE "dcuser.CH"
#include "dcxbrow.ch"
#include "cdxdbe.ch"
#include "dbfdbe.ch"
#include "foxdbe.ch"
*#include "dbesys.prg" // toto som niekde našiel na fóre s popisom ako nastaviť
// CDX, dbe,...
PROCEDURE DbeSys()
AceSetTableType("DBFCDX") // set the default table type to be ADS_CDX
* AceSetTableType("FOXCDX") // set the default table type to be ADS_CDX
/*
#ifdef _ENABLE_SQL_REPLICATION
// define ODBC connection to replicated database:
AceSQLReplicateConnection('DBQ=data\test.mdb;Driver={Microsoft Access Driver (*.mdb)};UID=admin;')
// define ADT or DBF tables that will be replicated:
AceSQLReplicate('AGENTS')
// add additional tables that you want to replicate here...
#endif
*/
Return
***************
FUNCTION Main
***************
LOCAL GetList := {}, oBrowse, aFields[3], aHeaders[3], aPres
LOCAL GetOptions, oToolBar, oDlg
LOCAL cAlias2 := "VL836915"
Set Deleted On
SET FIXED ON
SET DECIMALS TO 0
SET CHARSET TO OEM
*SET CHARSET TO ANSI
SET DATE GERMAN
*SET COLLATION TO GERMAN
SET COLLATION TO SYSTEM
use vl836915 ALIAS (cAlias2) NEW EXCLUSIVE
if used()
INDEX ON CLV TAG CLV
INDEX ON VLA TAG VLA
close all
endif
use vl836915 INDEX vl836915 ALIAS (cAlias2) NEW SHARED
set order to 1
go top
Dc_msgbox((cAlias2)->VLA) // this print field from DBF correctly !
*@ 1,1 DCBROWSE oBrowse ALIAS (cAlias2) SIZE 200,20 ;
@ 1,1 DCBROWSE oBrowse SIZE 200,20 ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW
* ??? error, alias problem ?
*DCBROWSECOL FIELD (cAlias2)->VLA
*DCBROWSECOL FIELD ((cAlias2)->VLA)
*DCBROWSECOL FIELD VL836915->VLA
*DCBROWSECOL FIELD VLA
*DCBROWSECOL FIELD "VLA"
*DCBROWSECOL FIELD 1->VLA
*DCBROWSECOL DATA {||((cAlias2)->VLA)}
*DCBROWSECOL DATA {||(cAlias)->VLA}
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Quick-Browsing a Database' FIT
close all
RETURN nil
PROC appsys
RETURN
I want examine use ADL to use DBF/CDX files via it, but some problems I have with it.
Open table is correct, however when I want open dbf table, which have CDX file present in directory and I write use table1 alias "T1" , this not open, and I must delete index file.
ok, I can do it
When after open table I want show record, for example
Dc_msgbox((cAlias2)->VLA)
where VLA is one from fields, this also works
but when want browse table, I examined many entries, but any not work, every time error invalid symbol/alias error.
Note : In ACE_UDF I have defined
//
#xtranslate VL836915-><f> => FieldWGet("VL836915",<"f">)
#xtranslate VL836915-><f> == <x> => FieldWGet("VL836915",<"f">) == <x>
...etc
where I use for alias same name as file DBF.
What can be here wrong ?
#INCLUDE "ACE_UDF.CH"
#INCLUDE "XBP.CH"
#include "dll.ch"
#include "common.ch"
#include "font.ch"
#INCLUDE "ACE.CH"
*#INCLUDE "SQL.CH"
*#INCLUDE "SQLEXT.CH"
#INCLUDE "INKEY.CH"
#INCLUDE "dcdialog.CH"
#INCLUDE "gra.CH"
#INCLUDE "appevent.CH"
#INCLUDE "dcuser.CH"
#include "dcxbrow.ch"
#include "cdxdbe.ch"
#include "dbfdbe.ch"
#include "foxdbe.ch"
*#include "dbesys.prg" // toto som niekde našiel na fóre s popisom ako nastaviť
// CDX, dbe,...
PROCEDURE DbeSys()
AceSetTableType("DBFCDX") // set the default table type to be ADS_CDX
* AceSetTableType("FOXCDX") // set the default table type to be ADS_CDX
/*
#ifdef _ENABLE_SQL_REPLICATION
// define ODBC connection to replicated database:
AceSQLReplicateConnection('DBQ=data\test.mdb;Driver={Microsoft Access Driver (*.mdb)};UID=admin;')
// define ADT or DBF tables that will be replicated:
AceSQLReplicate('AGENTS')
// add additional tables that you want to replicate here...
#endif
*/
Return
***************
FUNCTION Main
***************
LOCAL GetList := {}, oBrowse, aFields[3], aHeaders[3], aPres
LOCAL GetOptions, oToolBar, oDlg
LOCAL cAlias2 := "VL836915"
Set Deleted On
SET FIXED ON
SET DECIMALS TO 0
SET CHARSET TO OEM
*SET CHARSET TO ANSI
SET DATE GERMAN
*SET COLLATION TO GERMAN
SET COLLATION TO SYSTEM
use vl836915 ALIAS (cAlias2) NEW EXCLUSIVE
if used()
INDEX ON CLV TAG CLV
INDEX ON VLA TAG VLA
close all
endif
use vl836915 INDEX vl836915 ALIAS (cAlias2) NEW SHARED
set order to 1
go top
Dc_msgbox((cAlias2)->VLA) // this print field from DBF correctly !
*@ 1,1 DCBROWSE oBrowse ALIAS (cAlias2) SIZE 200,20 ;
@ 1,1 DCBROWSE oBrowse SIZE 200,20 ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW
* ??? error, alias problem ?
*DCBROWSECOL FIELD (cAlias2)->VLA
*DCBROWSECOL FIELD ((cAlias2)->VLA)
*DCBROWSECOL FIELD VL836915->VLA
*DCBROWSECOL FIELD VLA
*DCBROWSECOL FIELD "VLA"
*DCBROWSECOL FIELD 1->VLA
*DCBROWSECOL DATA {||((cAlias2)->VLA)}
*DCBROWSECOL DATA {||(cAlias)->VLA}
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Quick-Browsing a Database' FIT
close all
RETURN nil
PROC appsys
RETURN