Glue, screws or nails, this is a question that at some point every woodworker ask themselves when it comes to attaching molding to their casework. You just got the case assembled and now its time to put the crown and the intermittent moldings on and you have to decide what method to use to make them stay. This really depends what material you used for the case, if you have used sheet goods for the case then you don't have to worry about wood movement as much, so then gluing is a good option as long as you have the means to keep molding in place while the glue sets. There are some situations that you can blind nail or screw it from inside the case to hold it in place while the glue sets, this way you won't have to deal with filling any nail holes, which is always a pain.
One trick I use if I have to nail molding on, especially if it is an open gain wood that will hold wood filler and show up when I put the finish on. I will put a strip of blue tape on the molding where I plan on nailing, then shoot the pins in from a pin nailer though the tape and then fill the hole with a good wood filler like Elmer's, then when you pull the tape off it leaves the molding clean with no filler except in the hole. I then take a small blade from my razor knife and use it to scrap the nail hole level, when it is level I hit it with some 220 sand paper and it is ready to finish.
I never glue a piece of long grain molding across the grain of a case.This would prevent the wood in the case from moving and will eventually cause damage. this isn't as big a problem with plywood cases as it is with solid wood.
Sometime if I glued up solid boards to make the end panels for a case and I want to put a long grain molding across it, like a cove mold or a rail molding I will screw a dovetailed block to the case and then cut a matching dovetail slot in molding. this lets me slide the molding on to the keys where I will glue the fronts at the miters and the rest of the molding is free to move. I use the same method on angle blocks for coves and crowns, except when there isn't enough wood in the cove to rout a dovetail which in that case I cut screw slots in the end panels and screw the bocks down no glue. Then I glue and nail the cove to the blocks, the slots in the case let the block slide freely while hold the molding, you normally only have to do this on the end panels since the top rail is usually long grain.
Sometimes the moldings are to small for this technique, in that case I will glue the moldings at the front by the miter then shoot a few brads in the rest of the molding along its length that I didn't glue, The brads are flexible enough to let the wood move. I glue at the miters instead of gluing the middle of the moldings like a lot woodworking books recommend, this way the glue holds the miter in place and the brads holds the rest. This is the way many older woodworker did it and it works just find.
I do use screws in the construction of my work especially cabinets, they are fast and have great holding power when used right and mixed with glue. I use a Kreg Jig, but only in places that they will not be seen. I see tons of country furniture that has been screw together without any attempt to hide the screws. This always bugs me, there is nothing like seeing a nice rustic piece of furniture with a line of drywall screws staring you in the face.
I know a lot of you guys that don't think an air nailer has a place in their shop, but I would not get rid mine for all the hammers in the world, but I am not someone who use my nailer in place of good technique. I see so many pieces of furniture that have been slapped together using staples and hot melt polyurethane that it makes me sad. with a little bit of discretion and some good technique, screws and nails can help a lot in the construction of a piece of furniture or they can become a vulgar reminder of how we value speed and convenience, over tradition and proper technique. Which ever way you choose to attach molding to your case or to fasten your case together, just keep in mind what your striving for in the end, like how you want it to look, hide as much of the nails and screws that you can, use glue in a way that it will not cause damage from movement, and alway keep in mind that when you run a long grain piece of wood across the grain of another piece you have to allow for wood movement.