Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto Increasement Procedure
Message
De
20/03/2003 22:04:36
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Auto Increasement Procedure
Divers
Thread ID:
00768430
Message ID:
00768430
Vues:
40
Hi There,

I'm running a website on a VFP7 database which uses a automated VFP Procedure every time a record is added to the database. This works as expects on my local environment but when upload I receive a error every time I try to add a record. I am receiving this error because the Procedure is not being fired.

I'm am on a shared server. Could this be because they don't have the latest version of MDAC?

Here is the VFP procedure. Just to show you that all it does is auto increase the number in the ID fields in Tables.
FUNCTION NewID(tcAlias)
  LOCAL lcAlias, ;
        lnID, ;
        lcOldReprocess, ;
        lnOldArea, ;
        llUsed
 
  lnOldArea = SELECT()
  
  IF PCOUNT() < 1
    lcAlias = UPPER(ALIAS())
  ELSE
    lcAlias = UPPER(tcAlias)
  ENDIF
        
  lnID = 0
  lcOldReprocess = SET('REPROCESS')
  
  *-- Lock until user presses Esc
  SET REPROCESS TO AUTOMATIC
 
  IF !USED("SETUP")
    llUsed = .F.    
    USE reliez!setup IN 0
  ELSE
    llUsed = .T.   
  ENDIF
  SELECT setup
  SET ORDER TO TableName
      
  SEEK lcAlias
  IF FOUND()
    IF RLOCK()
      lnID = setup.value + 1
      REPLACE setup.value WITH lnID 
      UNLOCK
    ENDIF
  ENDIF
  
  IF !llUsed
     USE
  ENDIF
        
  SELECT (lnOldArea)
  SET REPROCESS TO lcOldReprocess
  
  RETURN lnID
ENDFUNC
Kind Regards,

Tarran Walker
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform