Using ADT files - a few questions

Using ADT files - a few questions

Postby TimStone » Wed Apr 25, 2012 10:02 pm

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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby Otto » Wed Apr 25, 2012 10:10 pm

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Using ADT files - a few questions

Postby TimStone » Wed Apr 25, 2012 10:40 pm

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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby Antonio Linares » Wed Apr 25, 2012 10:45 pm

Tim,

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

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

Re: Using ADT files - a few questions

Postby TimStone » Wed Apr 25, 2012 11:10 pm

I can follow up on that, but will it support the tdatabase class or will I re-write thousands of lines of code ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby norberto » Thu Apr 26, 2012 12:23 am

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
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR

Re: Using ADT files - a few questions

Postby TimStone » Thu Apr 26, 2012 2:12 am

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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby fraxzi » Thu Apr 26, 2012 3:35 am

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. :)
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Using ADT files - a few questions

Postby Otto » Thu Apr 26, 2012 7:35 am

Frances,
what access rights on the Server must an ADS user have.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6008
Joined: Fri Oct 07, 2005 7:07 pm

Re: Using ADT files - a few questions

Postby TimStone » Thu Apr 26, 2012 3:25 pm

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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby TimStone » Thu Apr 26, 2012 3:28 pm

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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby norberto » Thu Apr 26, 2012 3:37 pm

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
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR

Re: Using ADT files - a few questions

Postby TimStone » Thu Apr 26, 2012 3:50 pm

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
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Using ADT files - a few questions

Postby lucasdebeltran » Thu Apr 26, 2012 4:13 pm

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.)
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Using ADT files - a few questions

Postby TimStone » Thu Apr 26, 2012 4:20 pm

Thank you. I'll try that shortly.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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