How to use WORKSPACES?

  • Thread starter Thread starter greatmacoy
  • Start date Start date
G

greatmacoy

IS THIS A CORRECT WAY OF USING WORKSPACES TO ENSURE DATA INTEGRITY:

DIM WSP AS WORKSPACES
DIM DBS AS DATABASE

SET WSP=DBENGINE.WORKSPACES(0)
SET DBS=CURRENTDB

ON ERROR GOTO HANDLER
WSP.BEGINTRANS

DBS.EXECUTE "UPDATE .... "
DBS.EXECUTE "INSERT .... "

WSP.COMMITTRANS
DBS.CLOSE
WSP.CLOSE
EXIT SUB
HANDLER:
WSP.ROLLBACK
DBS.CLOSE
WSP.CLOS
 
Also change the dec to:

Dim WSP As DAO.WorkSpace

Suggest you post using proper capitalisation as it is hardier to read with
everything in CAPS.
 
Back
Top