Castanospermine mono- and di-esters and glycosides active as inhibitors of carbohydrate digestive enzymes and useful in treating diabetes are described herein. The compounds are prepared by the reaction of castanospermine with an appropriate acid halide or anhydride or with an appropriate glycosyl halide or glycosyl acetimidate under conditions which would favor the isolation of the mono- and di-esterified and glycosylated products. Various blocking groups, which can be selectively removed under mild conditions, can also be used to favor the formation of certain isomers.