in code how do i stop the db in PET?
I'm confused by your question - how do you stop the database via progress explorer in code?
Anyway, you can't stop it via the 4GL, except forking out to a os-command to do it.
To stop the database from the command line, you use the DBMAN utility documented in "Database Administration Utilities"
here.
If you mean how do I stop the database shown in Explorer using the comand line, well remember Progress Explorer is essentially a front end to utilities like DBMAN, and issuing a command by pressing a button will have the same effect as issuing the command via the OS - you just have to enter the appropriate parameters manually.