Page 1 of 2

Using ADT files - a few questions

PostPosted: Wed Apr 25, 2012 10:02 pm
by TimStone
It may be "old style", but I have continuously used .dbf files in my applications.

Now I'm considering using ADT files ( Advantage proprietary ), but I have a few questions:

1) Is there a driver ( currently using xHarbour .com version, older ) for ADT ?
2) I have all my file access performed with tdata ( and extension of tdatabase ) and I appreciate using data objects ... cleaner, easier to trace. Can these classes be used with ADT files ?
3) Will ADT files only be useable with the client server software, or can they be accessed with the local server in place ?

Probably my biggest central issue is that I use over 110 .dbf files ( with .dbt and .cdx files, thats a lot ). In the newer technologies a "database" is one file with many tables. ADT would allow me to duplicate that structure. I don't believe there is a way to do that with the .dbf files.

I am using xHarbour.com commercial from Aug. 2010, with the Pelles C compiler at the present time. No, I do not want to use BCC.

Tim

Re: Using ADT files - a few questions

PostPosted: Wed Apr 25, 2012 10:10 pm
by Otto
Tim,
what is the reason for considering to switch to ADS.
Have you ever thought of installing your software on a server and accessing the program with Remote Desktop.
This is such a great thing.
Best regards,
Otto

Re: Using ADT files - a few questions

PostPosted: Wed Apr 25, 2012 10:40 pm
by TimStone
Otto,

I am creating a new program that is extracted from my larger work. It is to be simple, and single user ( for now ).

The key is "simple" and so it would be nice to have it use one "database" with many internal tables rather then 100 separate .dbf files. I want what the clients sees to be lean !

I have many large installed sites and we have no problems with networking using ADS ( if they keep their computers virus free ).

Tim

Re: Using ADT files - a few questions

PostPosted: Wed Apr 25, 2012 10:45 pm
by Antonio Linares
Tim,

It may be a good oportunity to use MySQL with TDolphin from Daniel :-)

Re: Using ADT files - a few questions

PostPosted: Wed Apr 25, 2012 11:10 pm
by TimStone
I can follow up on that, but will it support the tdatabase class or will I re-write thousands of lines of code ?

Tim

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 12:23 am
by norberto
Tim, i use ADS since version 5, very stable and fast.

1) Is there a driver ( currently using xHarbour .com version, older ) for ADT ?
yes, xharbour and harbour have rddads driver.

2) I have all my file access performed with tdata ( and extension of tdatabase ) and I appreciate using data objects ... cleaner, easier to trace. Can these classes be used with ADT files ?
Yes, i use tdata from james bott with xharbour and harbour, in local and remote mode, without change of code ( 5 or 6 lines only)

3) Will ADT files only be useable with the client server software, or can they be accessed with the local server in place ?
Yes, ads have a local driver, but this local mode is for test ( says the vendor), and limited to few connections, but i know people using this in production mode.

with ads you can migrate your files now, without change of code, and with time, add more ads features like transaction, data dictionary, sql sentences, remote filters, etc...

but ADS is a SAP / Sybase company today, and this is not free... have a version free to 2 workstations and server, and local driver is free. http://www.sybase.com/products/database ... baseserver

Norberto

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 2:12 am
by TimStone
I am licensed with ADS and have sold their software for several years. If I want to use the proprietary adt files what do I need to set in my program?

Thanks.

Tim

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 3:35 am
by fraxzi
Hi Tim,

You need to create Data Dictionary wherein you can import all *.dbf into DD as .adt Using ARC.
This way you can secure your .adt (encrypted).

Include RDDADS in your app..
Create a connection to DD..

It is very simple and fun. :)

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 7:35 am
by Otto
Frances,
what access rights on the Server must an ADS user have.
Best regards,
Otto

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 3:25 pm
by TimStone
1) It would appear that I end up creating a group of separate .adt files just like the .dbf files. I thought ADS created a single database that housed all the tables, just like an SQL database.

2) Can you actually import the empty .dbf file structures ? I can't seem to find an option for doing that.

Tim

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 3:28 pm
by TimStone
Otto,

ADS is installed on the server, and of course it needs to be able to create files, and modify them ( read / write ). Since all of the work is done on the server, the clients can have limited access rights. Some of my customers are pretty minimal with the rights ganted on the workstation, but the client program I install on each one interacts with the ADS server with no problem.

Tim

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 3:37 pm
by norberto
Tim, Ads have Proprietary data types like incremental.
ads have install in server, or if use in local mode, you need :

ace32.dll
aceloc32.dll
ansi.chr
adslocal.cfg
ads.ini
axcws32.dll

in local dir of application. download ace from ads.

and link you appl with rddads.lib and ace32.lib.

in your souce have put this lines:

#include "ads.ch"

REQUEST ADS, ADSKeyNo, AdsKeyCount, AdsGetRelKeyPos, AdsSetRelKeyPos
rddRegister( "ADS", 1 ) // 1 , 2 , 7
rddsetdefault( "ADS" )
SET(_SET_OPTIMIZE, .t.)
SET SERVER LOCAL //AdsSetServerType(1)
SET FILETYPE TO ADT //AdsSetFileType(3)

you can create your databases with arc32.


norberto

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 3:50 pm
by TimStone
Hi Norberto,

I had no problem with the actual ADS install and setup in the program. I have that all in place because I use ADS already with my .dbf files in my application, and I'm authorized as a reseller of the server software.

I am creating a small program, derived from my larger application. I didn't want to re-write all my code, but I thought for simplicity it would be nice to have one database that held all the tables, rather then 100 different .dbf files ( just like SQL does ). I thought that could be done with an .adt database, but apparently not. Looking at an earlier post, I was told to create the Data Dictionary and import the tables, but I can't find a tool that will import empty .dbf files into new .adt tables.

I'll look at the docs now to see if I can clarify my understanding. However, my point was it would be nice to reduce the number of files I distribute by having on database and not 100 .dbf's.

Tim

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 4:13 pm
by lucasdebeltran
Hi Timm,

This routine will help you:

Code: Select all  Expand view
FUNCTION Main()
   LOCAL aDbfs := DIRECTORY(".\*.dbf")
   LOCAL nDbfs
   LOCAL aEstructura
   LOCAL cNomAdt, cNomAdi, cNomAdm
   LOCAL nReng := 0
   REQUEST ADS,DBFNTX,DBFDBT
   RDDSETDEFAULT("ADS")
   AdsSetServerType(1)
   AdsSetFileType(3)
   CLS
   FOR nDbfs := 1 TO LEN(aDbfs)
      /* obtenemos el nombre del DBF y le agregamos la extension ADT */
      cNomAdt := LEFT(aDbfs[nDbfs,1],AT(".",aDbfs[nDbfs,1]))+"ADT"
      cNomAdi := LEFT(aDbfs[nDbfs,1],AT(".",aDbfs[nDbfs,1]))+"ADI"
      cNomAdm := LEFT(aDbfs[nDbfs,1],AT(".",aDbfs[nDbfs,1]))+"ADM"
      @ nReng, 1 SAY cNomAdt
      /* abrimos el DBF usando el RDD DBFNTX*/
      USE (aDbfs[nDbfs,1]) NEW ALIAS TempDbf VIA "DBFNTX"
      /* obternemos la estructura del DBF */
      aEstructura := TempDbf->(DBSTRUCT())
      /* verficamos si existe el archivo ADT, su indice ADI y su memo ADM, si existen los borramos*/
      IF FILE (".\"+cNomAdt)
         FERASE("
.\"+cNomAdt)
      ENDIF
      IF FILE (cNomAdi)
         FERASE("
.\"+cNomAdi)
      ENDIF
      IF FILE (cNomAdm)
         FERASE("
.\"+cNomAdm)
      ENDIF

      /* creamos una nueva estructura ADT a partir de la estructura DBF previamente obtenida */
      /* abrimos la nueva estructura con el el alias "
TempAdt" */
      DBCREATE(cNomAdt,aEstructura,"
ADS",.T.,"TempAdt")

      /* al primer registro del DBF */
      TempDbf->(DBGOTOP())

      /* vamos a recorrer todo el DBF para cargar los datos al ADT */
      DO WHILE ! TempDbf->(EOF())
         /* aƱadimos un registro al ADT */
         TempADT->(DBAPPEND())
         /* agregamos la informacion de los registros campo por campo*/
         FOR nCampos := 1 TO TempDbf->(FCOUNT())
            TempAdt->(FIELDPUT(nCampos,TempDbf->(FIELDGET(nCampos))))
         NEXT
         TempDbf->(DBSKIP())
      ENDDO

      /*cerramos todo */
      DBCLOSEALL()
      nreng++
   NEXT
RETURN (.T.)

Re: Using ADT files - a few questions

PostPosted: Thu Apr 26, 2012 4:20 pm
by TimStone
Thank you. I'll try that shortly.

Tim