Medical treatment techniques have been improved continuously in the past years. However, the better approaches are still needed to solve medical treatment problems. One important topic in this field is the analysis and prevention of medication errors. In this paper, we focus on the problem of dispensing error that is one important problem of medication errors and we proposed a prevention model by using three approaches. The proposed dispensing error mining framework consists of two phases, namely the modeling and prediction phases. Firstly, Statistical approach (logistic regression) and data mining approaches (C4.5 and SVM) are used to analyze dispensing error problem and to build classification models. Three kinds of factors, namely drug-names factor, drug-properties factor and environmental factor, with totally thirteen attributes are used in the modeling phase. In prediction phase, new drugs thus can be analyzed for the probability of dispensing error by the model so as to prevent dispensing error. At last, experimental results on real dataset showed that the proposed approach is effective and the considered factors can actually increase the accuracy of the model.