Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto Increasement Procedure
Message
From
20/03/2003 22:04:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Auto Increasement Procedure
Miscellaneous
Thread ID:
00768430
Message ID:
00768430
Views:
41
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
Next
Reply
Map
View

Click here to load this message in the networking platform