ADS and autoincremental fields

Post Reply
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

ADS and autoincremental fields

Post by MOISES »

Hi,

Is there a way to support it in dbf databases:

Code: Select all

{ "ID",         "+",  10,   0 }
Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: ADS and autoincremental fields

Post by nageswaragunupudi »

MOISES wrote:Hi,

Is there a way to support it in dbf databases:

Code: Select all

{ "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
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: ADS and autoincremental fields

Post by MOISES »

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
User avatar
carlos vargas
Posts: 1421
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: ADS and autoincremental fields

Post by carlos vargas »

this example work with ads

Code: Select all

#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)
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: ADS and autoincremental fields

Post by MOISES »

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
User avatar
carlos vargas
Posts: 1421
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: ADS and autoincremental fields

Post by carlos vargas »

yes, not work. ace fail open customer.dbf from fwh sample folder!
Image
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: ADS and autoincremental fields

Post by MOISES »

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
Post Reply