Subject ACE Wrappers and BROWSE Alias
From Victorio <> <Victorio <>>
Date Fri, 15 Jun 2018 18:49:40 +0100
Newsgroups sqlexpress

Hi,
I want examine use ADL to use DBF/CDX files via it, but some problems I have with it.
But still not work for me.

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.

I do not know how identify, where is problem, if Xbase do not know alias, or DCBROWSE do not accept alias, or something elxe.

Note : In ACE_UDF I have defined
//
#xtranslate VLASTNICI-><f> => FieldWGet("VLASTNICI",<"f">)
#xtranslate VLASTNICI-><f> == <x> => FieldWGet("VLASTNICI",<"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 cAlias1 := "VLASTNICI"

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 (cAlias1) NEW EXCLUSIVE
if used()
INDEX ON CLV TAG CLV
INDEX ON VLA TAG VLA
close all
endif

use vl836915 INDEX vl836915 ALIAS (cAlias1) NEW SHARED
set order to 1

go top

DC_msgbox(str(select()))        // ok, return number 1
DC_msgbox(alias())                // ok, return VLASTNICI

Dc_msgbox((cAlias1)->VLA)                // ok
*Dc_msgbox(cAlias1->VLA)                // zle
Dc_msgbox(VLASTNICI->VLA)                // ok
Dc_msgbox(Fieldwget(cAlias1,"VLA"))        // ok
Dc_msgbox(Fieldget(Fieldpos("VLA")))        // ok        


@ 1,1 DCBROWSE oBrowse ALIAS (cAlias1) SIZE 200,20 ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW

* ??? error, alias problem ? any from this not wort, still error symbol/alias

*DCBROWSECOL FIELD (cAlias1)->VLA            // still error alias
*DCBROWSECOL FIELD ((cAlias1)->VLA)
*DCBROWSECOL FIELD VLASTNICI->VLA        
*DCBROWSECOL FIELD VLA
*DCBROWSECOL FIELD "VLA"
*DCBROWSECOL FIELD 1->VLA
*DCBROWSECOL DATA {||((cAlias1)->VLA)}
*DCBROWSECOL DATA {||(cAlias1)->VLA}

DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Quick-Browsing a Database' FIT

close all

RETURN nil


PROC appsys
RETURN


Recent messages in this thread
 
.# ACE Wrappers and BROWSE Alias (Current message) Victorio <> 15-Jun-2018 01:49 pm