A microneedle array, constructed of silicon and silicon dioxide compounds or of a molded plastic material, is provided to penetrate the stratum corneum and epidermis layers of skin, but not into the dermis. The microneedles can be used to either dispense a liquid drug, or to sample a body fluid. The delivery of drugs and sampling of fluids can be performed by way of passive diffusion (time release), instantaneous injection, or iontophoresis. A complete closed-loop system can be manufactured including active elements, such as micro-machined pumps, as well as passive elements such as sensors. A “smart patch” can thereby be fabricated that samples body fluids, performs chemistry to decide on the appropriate drug dosage, and then administers the corresponding amount of drug. An electric field may be used to increase transdermal flow rate. Such a system can be made disposable, and can be used with medical devices to dispense drugs by iontophoretic/microneedle enhancement, to sample body fluids (while providing an iontophoretically/microneedle-enhanced body-fluid sensor), and as a closed-loop drug delivery system with fluid sampling feedback using a combination of the other two devices. As a drug dispensing system, the microneedle array includes electrodes that apply an electric potential to the skin between the electrode locations. One of the electrode assemblies is filled with an ionized drug, and the charged drug molecules move into the body due to the applied electric potential. As a body-fluid sampling system, the microneedle array also includes electrodes to assist in moving fluid from the body into a receiving chamber, and which further includes a bioelectrochemical sensor to measure the concentration of a particular substance.