ADS and autoincremental fields

ADS and autoincremental fields

Postby MOISES » Mon Feb 24, 2020 10:38 am

Hi,

Is there a way to support it in dbf databases:

Code: Select all  Expand view
{ "ID",         "+",  10,   0 }


Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: ADS and autoincremental fields

Postby nageswaragunupudi » Mon Feb 24, 2020 7:34 pm

MOISES wrote:Hi,

Is there a way to support it in dbf databases:

Code: Select all  Expand view
{ "ID",         "+",  10,   0 }


Thank you.

This is already supported in DBFCDX.
fwh\samples\customer.dbf has the first field ID as autoinc field.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADS and autoincremental fields

Postby MOISES » Mon Feb 24, 2020 7:40 pm

Yes, but I asked in ADS. I get an error: field type not supported.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: ADS and autoincremental fields

Postby carlos vargas » Mon Feb 24, 2020 10:05 pm

this example work with ads
Code: Select all  Expand view
#include "common.ch"
#include "dbinfo.ch"
#include "ads.ch"

REQUEST ADS
//REQUEST DBFCDX, DBFFPT
REQUEST HB_LANG_ESWIN, HB_CODEPAGE_ESWIN

//EXTERNAL OrdKeyNo, OrdKeyCount, OrdKeyGoTo, OrdKeyRelPos
EXTERNAL AdsKeyNo, AdsKeyCount, AdsGetRelKeyPos, AdsSetRelKeyPos

PROCEDURE Main()
  LOCAL aStruct := { ;
         { "CHARACTER", "C", 25, 0 }, ;
         { "NUMERIC"  , "N",  8, 0 }, ;
         { "DOUBLE"   , "N",  8, 2 }, ;
         { "DATE"     , "D",  8, 0 }, ;
         { "LOGICAL"  , "L",  1, 0 }, ;
         { "MEMO1"    , "M", 10, 0 }, ;
         { "MEMO2"    , "M", 10, 0 }, ;
         { "MYRECNO"  , "+", 4, 0  }  } /*work ok with + and Autoinc*/

  hb_LangSelect(  "ESWIN" )
  hb_SetCodePage( "ESWIN" )

  RddSetDefault( "ADS" )
   
  set date brit
  set cent on
  set opti on
  set dele on
 
  SET SERVER LOCAL
  SET AXS LOCKING OFF
  SET RIGHTS CHECKING OFF
  SET CHARTYPE TO ANSI
  SET FILETYPE TO ADT
 
  SetMode(25,80)
  cls
 
  WAIT "Exist table: " + iif( hb_dbExists( "testdbf" ), "Si", "No" )
 
  IF !hb_dbExists( "testdbf" )
    DbCreate( "testdbf", aStruct, "ADS", .T., "mylias" )
    index on CHARACTER to char01
  ELSE
    USE testdbf NEW ALIAS myalias
    SET INDEX TO char01
    WAIT "IndexOrder: " + hb_ntos( OrdNumber() ) + " / " + OrdKey()
  ENDIF
 
  Browse()
 
  use
 
RETURN
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1720
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: ADS and autoincremental fields

Postby MOISES » Tue Feb 25, 2020 9:50 am

Thank you very much, Carlos.

The problem occurs if a DBF with autoincremental created with DBFCDX is opened with ADS, then it fails.

We must re-generate the table with the ADS driver.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: ADS and autoincremental fields

Postby carlos vargas » Tue Feb 25, 2020 5:48 pm

yes, not work. ace fail open customer.dbf from fwh sample folder!
Image
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1720
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: ADS and autoincremental fields

Postby MOISES » Wed Feb 26, 2020 10:02 am

Yes, thats the problem.

It seems that ADS is abandoned by Sybase. Am i right?
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 81 guests