ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Tue Oct 09, 2012 6:19 am

Dear All,

Can someone help me?
I'm trying to convert all my program to ADS.

how to use function encrypt and decrypt from fivewin for indexing in ADS.


Code: Select all  Expand view
#INCLUDE "FiveWin.ch"
#include "Directry.ch"
#INCLUDE "ORD.CH"
#include "ads.ch"

extern dbfcdx
REQUEST     ADS             ,;
            ADSKeyno        ,;
            ADSKeycount     ,;
            AdsGetRelKeyPos ,;
            AdsSetRelKeyPos
           
           
static oWnd

*-- FUNCTION -----------------------------------------------------------------
* Name........: Main
* Description.:
* Parameters..:
* Return value: nil
* Author......:
*-----------------------------------------------------------------------------
function Main()
       
       SET(_SET_OPTIMIZE,.T.)
       request DBFCDX
       //-----setting ads
       Rddsetdefault("ADS")
       ADSSETSERVERTYPE(7)
       ADSSETFILETYPE(ADS_CDX )
       AdsSetDateFormat("DD/MM/YYYY")
       AdsSetEpoch("01/01/2000")
       ADSRightsCheck(.F.)
       ADSLocking( .T. )
       
   
      use customer new via 'ADS'
      index on ENCRYPT(first,'TEST')  tag FI TO CUSTOMER
      BROWSE()
return nil


 


thanks

kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby richard-service » Tue Oct 09, 2012 8:10 am

Hi Kok,

You mean it...
Code: Select all  Expand view

cAlias := GiveAlias ( cAlias )
USE (cFile) NEW SHARED ALIAS (cAlias) VIA "ADS"
AdsEnableEncryption( cWord )
cAlias := Alias()

      IF !File ( cCDX )
         IF (cAlias)->(FLock())
            INDEX ON FIELD->UNIT_NO   TAG UnitMsf1 TO ( cCDX ) FOR !Deleted()
            INDEX ON FIELD->UNIT_CNM  TAG UnitMsf2 TO ( cCDX ) FOR !Deleted()
            INDEX ON FIELD->UNIT_DES  TAG UnitMsf3 TO ( cCDX ) FOR !Deleted()
            INDEX ON FIELD->UNIT_ENM  TAG UnitMsf4 TO ( cCDX ) FOR !Deleted()
            (cAlias)->(DbUnLock())
         ENDIF
         SET INDEX TO ( cCDX )
      ENDIF

      SET ORDER TO "UnitMsf1"
      (cAlias)->( DBGoTop() )
 
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Tue Oct 09, 2012 8:19 am

Hi Richard ,

Thank for your reply,
but I don't want use function from ADS , I must use function encrypt from fivewin.

regards,

kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby Marcelo Via Giglio » Tue Oct 09, 2012 12:35 pm

Hola,

I don´t know why you want to use encrypt function from FW, but if you really need it, I think you can create a extra field with encrypted data and create the index over this field

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Tue Oct 09, 2012 1:11 pm

Hi Marcelo,
All my new programs, I use function from ADS.
I need encrypt from fivewin for my old program that use this function for indexing.

Regards,
Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby Patricio Avalos Aguirre » Wed Oct 10, 2012 9:46 pm

Hi

No esta permitido usar funciones de usuario en los indices
No this allowed using user's shows in index them
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Wed Oct 10, 2012 11:26 pm

Hi Patricio,

But it works perfectly without ADS.
Regards

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby Marcelo Via Giglio » Thu Oct 11, 2012 2:33 am

kok,

because ADS RDD is related to ADS Server, you can't use other function not implemented in ADS, please read the ADS documentation, and you will see the allowed function list allowed.

The other way is how I mentioned previously, adding a field with the crypted data

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Thu Oct 11, 2012 4:46 am

Hi Marcelo,

Thank you for your reply.

If I write like this :

use customer new via 'DBFCDX'
index on ENCRYPT(first,'TEST') tag FI TO CUSTOMER

everything work fine in ADS .

yes, I Agree with you, It's about ADSCDX
I think need Antonio help to join this function Encrypt and decrypt

Regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby Antonio Linares » Thu Oct 11, 2012 9:17 am

Kok,

AFAIK ADS provides its own encryption functions, so you should use theirs

I am not used to them, but surely another ADS user may help on this
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby reinaldocrespo » Fri Oct 12, 2012 4:37 pm

In a 2-tier (true client-server) application, data is managed by the server. Index operations are performed on the server end. Without ADS, (that's when the server is only used as a shared drive) each record travels from the shared drive on the server to the workstation where decisions and operations are done before they are sent back to the server for a disk-write. With ADS data no longer travels to the workstation to then comeback to the server. Everything happens on the server end. That's one of the reasons ADS RDD is so much faster. The server take the index command from the client and "knows" what to do without sending each record to be "analyzed" by the client. The problem with your encrypt function is that it "lives" on the the client workstation while the server "knows" nothing about it. For this reason your user defined function on the workstation used to crete the index, is invalid on the server. Most regular clipper functions already exists on the ADS server (trim, left, right, ...), you can read the help file to see the list. FiveWin's encrypt and decrypt are not in the list as they are not even valid clipper functions.

As you guessed, you may continue to use DBFCDX RDD for certain tables, but you now loose all the benefits of a true client-server paradigm.

Hope that helps,

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Fri Oct 12, 2012 5:51 pm

Dear Reinaldocrespo,

Thank you for the explanation.
I like client server from ADS, very fast.

yes,I do not have any option to use a power from ADS for my old program, except I change the structure of indexing.

Regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby reinaldocrespo » Fri Oct 12, 2012 6:21 pm

BTW - since we are on this subject, I might as well add some more information. In a client-server paradigm (like any SQL including ADS SQL), index or table corruption is very unlikely. The reason tables and indexes get corrupted is because something happens that breaks or interrupts the communication between the shared drived and the workstation. When this happes, for whatever reason including network failures, and data was either being read or written to the shared drive, corruption occurs. In a 2-tier paradigm, this doesn't happen since read and writes are all managed by the server regardless of the workstation status.

Back when ADS was young, it was advertised as a tool to avoid corruption. The original developers didn't intend to write an SQL. All they did was mostly re-write the communications layer so that all Clipper dbf operation would be carried out by the server. These were Clipper and c programmers writing mobile code. Their .dbfs and ntxs used get corrupted all the time, so they decided to do something about it. That's how ADS was born.

An SQL company called iAnywhere got interested on their mobile code and patents and decided to buy them. The unintended consequence is that they also got ADS SQL. Then Sybase got interested on the mobile technology that was acquired by iAnywhere and thus, decided to buy them out. The unintended consequence is that they now also acquired two SQLs (iAnywhere and ADS). Sybase already owned ASE (adaptive server which is the parent of MS-SQL server) as well as AI. So now Sybase owned 4 SQLs. Recently SAP got interested on all this mobility technology and patents, and ended up purchasing Sybase for 8 billion dollars. So now, ADS belongs to SAP. In essence, with ADS there is more SQL know-how and expertise than at any other company.

Now days ADS is much more than just a means to avoid corruption. Now you get everything other "bigger" and more expensive SQLs have while also keeping the original clipper like syntax. The demands of more modern and complex ways to manage data, forces us each day to migrate more and more towards SQL and multi-tier paradigms. ADS -with its clipper like ISAM RDD -just makes it a little easier to get started. But once you have migrated to ADS REMOTE server, you need to start taking it a step further and learn SQL, triggers, Referential Integrity rules, Web Services + Mobile data access, data dictionary. It takes time. The good news is that you get to keep working with .dbf/fpt/cdx and .adt/adm/adi.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby kok joek hoa » Sat Oct 13, 2012 6:47 am

Dear Reinaldo,

Thank you for this useful information.
Did you use ADS 11?
I wanna know about web-paltform from ADS 11.

Regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: ADS NOT SUPPORT DECRYPT AND ENCRYPT FROM FIVEWIN

Postby HunterEC » Sat Oct 13, 2012 12:36 pm

Reinaldo, kok joek hoa:

Very precise explanation of the client / server paradigm.

On encryption, commercial xHarbour supports a driver called SIX, which allows transparent record encryption. I'd used since the old Clipper 5.2e / DOS days and now with xHarbour without any trouble at all.

There's another way to get the speed benefits of client / server: Remote Desktop Connection. You connect via remote and everything happens at the host / server level. No need for data records to travel through the network back and forth. There are a couple of patches on the Web for Windows XP Professional, Vista & 7 that allows you to connect remotely, without disconnecting the user on the host / server. The patch also supports lots of users simultaneously. I've used on a 15 node network and works smoothly.

Also, this way, you got only a single point of failure, as in client / server, the server.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 54 guests