Page 1 of 1

Third Party software to export ADT to DBF files ?

Posted: Wed Aug 24, 2011 10:46 am
by pierredaou
Hi again,

To your knowledge, is there any third party software - command-line -capable of converting /exporting ADT ( Advantage ) files into DBF's ?

Regards

Re: Third Party software to export ADT to DBF files ?

Posted: Wed Aug 24, 2011 6:16 pm
by rdonnay
I doubt that you will find anything that is command-line based, but you can probably do this with the Advantage Architect. You may even be able to use SQL commands. Are you familiar with Advantage SQL?

Re: Third Party software to export ADT to DBF files ?

Posted: Thu Aug 25, 2011 3:26 am
by pierredaou
Absolutely, I already use Advantage Database. Arc32 do not allow command line (at least no documentation exists for this specific option), and even the SQL script cannot be launched automatically. You should go into ARC32 and then call the file to run the script. I found something called ABC AMBER ADVANTAGE, but I do not know whether it is efficient or not, and no support is available.

Thanks Anyway.

Re: Third Party software to export ADT to DBF files ?

Posted: Fri Aug 26, 2011 5:44 pm
by rdonnay

Code: Select all

/*

This program is used to run a *.SQL file.

It does NOT require ADSDBE

It can connect to a Data Dictionary or a directory of tables.

*/

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL i, cParam, cUserName, cPassword, cDataPath, cStatement, ;
      nLockingMode, nIndexMode, cServer, cSQLFile, lDeleteSQLFile, ;
      lExit, lAlways, lStatus

DEFAULT cDataPath := DC_Path(AppName(.t.)), ;
        cServer := cDataPath, ;
        nLockingMode := 1, ;
        nIndexMode := 2, ;
        lDeleteSQLFile := .f., ;
        lExit := .f., ;
        lAlways := .f.

FOR i := 1 TO PCount()
  cParam := PValue(i)
  IF !Empty(cParam)
    IF Upper(cParam) = '/SRV:'
      cServer := SubStr(cParam,6)
    ELSEIF Upper(cParam) = '/USR:'
      cUserName := SubStr(cParam,6)
    ELSEIF Upper(cParam) = '/PWD:'
      cPassword := Substr(cParam,6)
    ELSEIF Upper(cParam) = '/PATH:'
      cDataPath := Substr(cParam,7)
    ELSEIF Upper(cParam) = '/LOCK:'
      nLockingMode := Val(Substr(cParam,7))
    ELSEIF Upper(cParam) = '/INDEX:'
      nIndexMode := Val(Substr(cParam,8))
    ELSEIF Upper(cParam) = '/SQL:'
      cSqlFile := Substr(cParam,6)
    ELSEIF Upper(cParam) = '/DEL'
      lDeleteSqlFile := .t.
    ELSEIF Upper(cParam) = '/EXIT'
      lExit := .t.
    ELSEIF Upper(cParam) = '/ALWAYS'
      lAlways := .t.
    ELSEIF '/?' $ cParam .OR. '/H' $ Upper(cParam)
      ShowOptions()
    ELSEIF cParam = '/'
      DC_WinAlert('Unknown command line parameter: ' + cParam)
    ENDIF
  ENDIF
NEXT

IF PCount() == 0
  ShowOptions()
  QUIT
ENDIF

IF !Empty(cSqlFile) .AND. FExists(cSqlFile)
  cStatement := MemoRead(cSqlFile)
ENDIF

lStatus := DC_AdsSqlQuery( cServer, cUserName, cPassword, cDataPath, , ;
                           nIndexMode, nLockingMode,, cStatement, lExit, lAlways )

IF (Valtype(lStatus) == 'L' .AND. lStatus) .OR. lAlways
  IF lDeleteSqlFile .AND. !Empty(cSqlFile)
    FErase(cSqlFile)
  ENDIF
ENDIF

RETURN nil

* --------------

PROC appsys ; RETURN

* --------------

STATIC FUNCTION ShowOptions()

DC_MsgBox({'Command line Options:', ;
           '', ;
           '/srv:<server> - Set dictionary (.add) name or Drive Letter', ;
           '/usr:<user> - Set user name', ;
           '/pwd:<pwd> - Set password', ;
           '/path:<path> - Set Data Path', ;
           '/lock:<locking mode> - 0=Compatible, 1=Proprietary (default)', ;
           '/index:<index mode> - 1=NTX, 2=CDX (default)', ;
           '/sql:<sql file> - SQL to Run', ;
           '/del - Delete the SQL File after Executing Statement', ;
           '/exit - Exit program after Executing Statement', ;
           ''}, ;
           ,,,,,,,,,,,'8.Courier')

RETURN nil