bb.donnay-software.com

Donnay Software Web Forums
It is currently Fri May 29, 2020 7:35 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: cobasystems@gmail.com
PostPosted: Sun Nov 10, 2019 11:53 am 
Offline

Joined: Mon Apr 25, 2011 8:57 am
Posts: 8
Hi Master Roger,

* Problem to solve when working with ADS remote server:
*----------------------------------------------------------------
UTF-8 unicode strings should be downloaded from Oracle or PgSQL table in
the Alaska Xbase ++ DBF table, but so that the correct text is preserved.
This was only possible through an ADT table that has a 'nchar' type field
for unicode characters.

I wrote a program that uses java JDBC to transfer unicode data from
Oracle table to ADT table. The data was successfully transferred to
the ADT table.

Now it is necessary to transfer data from the ADT table to the DBF table
with the previous one translating unicode characters into Esc sequences
(one unicode character = 6 ASCII characters)
Problem: Alaska ADSDBE opens and reads the ADT board. But if the ADT
board has an 'nchar' type field then ADSDBE does not see that field.

Function ADS_ADT_TABLE () is a test program that demonstrates this.
== Roger, Is there a way that the 'nchar' field can be seen from ADSDBE ? ==


Code:

#include "Appbrow.ch"
*************************************************************************
FUNCTION ADS_ADT_TABLE()
*************************************************************************
* 1. SET ADS.INI
*---------------------------------------------
*  [SETTINGS]
*  ; 1 - Local, 2 - Client, 3 - Try Client, fall back to Local, 4 - Internet (AIS)
*  ADS_SERVER_TYPE=2
*  ; NTX or CDX or ADI
*  ; ADS_INDEX_TYPE=CDX
*  ; ADS_INDEX_TYPE=NTX
*  ADS_INDEX_TYPE=ADI
*  MTIER_LOCAL_CONNECTIONS=1



* 2. SET DBESYS()
*---------------------------------------------
*  DbeLoad("ADSDBE")
*  DbeSetDefault("ADSDBE")
*  DbeInfo( COMPONENT_DATA , ADSDBE_TBL_MODE, ADSDBE_ADT)
*  DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_ADT)
*  DbeInfo( COMPONENT_DATA, ADSDBE_LOCK_MODE, ADSDBE_PROPRIETARY_LOCKING )
*---------------------------------------------



* 3. SET APPLICATION ADS SERVER SESSION
*---------------------------------------------
  PUBLIC oSession, server_DRIVE := CurDrive() + ":"
   // connect to the ADS server
  cSession := "DBE=ADSDBE;SERVER=" + server_DRIVE
  oSession := dacSession():New( cSession )
  // check if we are connected to the ADS server
  IF ( oSession:isConnected( ) ) == .F.
       msgbox("Error: ADS Connection")
     RETURN .F.
  ENDIF


* 4. SET ADT TABLE
*-----------------

dbeSetDefault("ADSDBE")

//-------------------------------------------------- TEST1.ADT
//bErrorBlock := ErrorBlock({|e|_TrapError(e)})
//BEGIN SEQUENCE

 USE TEST1.ADT NEW

 *** Structure TEST1.ADT view in Advantage Data Architect:
 *** field name INTEGER data type numeric size 15,0
 *** field name REAL    data type numeric size 16,2


//END SEQUENCE
//ErrorBlock(bErrorBlock)

 APPBROWSE ;
 TITLE "TEST1.ADT ---> There is not Field name: UNICODE type: nchar";
 POSITION CENTER SIZE 40 PERCENT
 APPDISPLAY
 *** APPDISPLAY: INTEGER and REAL

 USE // USE is OK
//-------------------------------------------------- TEST1.ADT


//-------------------------------------------------- TEST2.ADT
//bErrorBlock := ErrorBlock({|e|_TrapError(e)})
//BEGIN SEQUENCE

 USE TEST2.ADT NEW

 *** Structure TEST2.ADT view in Advantage Data Architect:
 *** field name INTEGER data type numeric size 15,0
 *** field name REAL    data type numeric size 16,2
 *** field name UNICODE data type nchar   size  128 ***

//END SEQUENCE
//ErrorBlock(bErrorBlock)

 APPBROWSE ;
 TITLE "TEST2.ADT ---> There is a Field name: UNICODE type: nchar (not shown ?)";
 POSITION CENTER SIZE 40 PERCENT
 APPDISPLAY
 *** APPDISPLAY: INTEGER and REAL, and not UNICODE ???

 USE // USE is NOT OK: Error BASE/5:
        // Description: Internal data structures corupted
        // Operation: DbCloseArea
//-------------------------------------------------- TEST2.ADT

// disconnect from the ADS
   oSession:disconnect()
RETURN .T.

STATIC FUNCTION _TrapError()
// disconnect from the ADS
 oSession:disconnect()
 BREAK
RETURN nil



Top
 Profile  
 
PostPosted: Mon Nov 11, 2019 7:08 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Please attach your ADT file.

I am guessing that the problem may be in APPBROWSE.

Do you have eXpress++?

Try opening the file with Xdot.Exe and then BROWSE.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Tue Nov 12, 2019 5:53 pm 
Offline

Joined: Mon Apr 25, 2011 8:57 am
Posts: 8
Hi Roger,

I'm sending test files to TEST1.ADT and TEST2.ADT
Programs:
   CDBF.EXE
   DBFviewer PRO
   DBFplus.EXE
   DBFview.exe (Advantage Database Server client software)
cannot open TEST2.ADT file
Only the Advantage Data Architect program opens the TEST2.ADT file

ADSDBE engine opens TEST2.ADT file but no nchar field!

I'm using Alaska Xbase ++ 1.9 355 SL1
I'm using eXpress ++ Version 1.9 build 259.

Can Alaska Xbase ++ work with ADT board with nchar field ???


Attachments:
File comment: Test2.adt (field type nchar)
TEST2.ADT.zip [571 Bytes]
Downloaded 118 times
Top
 Profile  
 
PostPosted: Wed Nov 13, 2019 11:50 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
I can confirm that there are problems with TEST2.ADT.

There appears to be a problem with supporting UNICODE fields with ADSDBE.

I am trying to find a workaround.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Wed Nov 13, 2019 12:35 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
The only workaround that will work is using the ODBCDBE instead of the ADSDBE.

You will need to use the {Advantage StreamlineSQL ODBC} driver.

You will also need to put your ADT files into a Data Dictionary.

I tested this using SqlQuery.EXE.

I created a Data Dictionary named CobaSystems.Add with the Architect and added the ADT files.

I then made an ODBCDBE connection using the following connection string:

DBE=ODBCDBE ;
DRIVER={Advantage StreamlineSQL ODBC} ;
DataDirectory=C:\cobasystems\cobasystems.add ;
UID=AdsSys ;
ServerTypes=2

After making the connection I was able to use SQL queries or open the tables using ISAM.

Where are you located?
If you have TeamViewer or Skype I can show you this on my computer.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Wed Nov 13, 2019 4:23 pm 
Offline

Joined: Mon Apr 25, 2011 8:57 am
Posts: 8
Roger thanks for the help,

i did everything the same as you
all according to your instructions
and I got a good result.

:D


Top
 Profile  
 
PostPosted: Thu Nov 14, 2019 7:56 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Quote:
I got a good result


That is great. I'm glad I could help.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group