>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
Tarran,
Via remote inserts stored procs are not fired automatically. You should call it yourself to get the newid and send it too. ie :
set oRs = oConn.Execute("NewID('myTable')")
Then you can use oRS.Fields(0).Value.
Cetin