引用MicrosoftDAO3.6ObjectLibraryPublicFunctionDaoOpenDB(ByValpDbTypeAsString,ByValpDbNameAsString,ByValpMdbCnctAsString)AsIntegerOnErrorGoToErr_HandlerDimm_DbDataBaseAsDAO.DatabaseDimgwsMainworkSpaceAsDAO.WorkspaceDimDAODBEngineAsNewDAO.DBEngine()Dimm_DbWkSpace=DAODBEngine.CreateWorkspace("","Admin","")IfpDbType="c_ACCESS"Then'Accessm_DbDataBase=m_DbWkSpace.OpenDatabase(pDbName)Else'Oraclem_DbDataBase=m_DbWkSpace.OpenDatabase(pDbName,True,False,pMdbCnct)EndIfDaoOpenDB=c_OK'你在全局中已定义ExitFunctionErr_Handler:DaoOpenDB=c_NG'你在全局中已定义MsgBox(Err.Description,MsgBoxStyle.OkOnly+MsgBoxStyle.Critical,"Err")EndFunction
这叫倒行逆施啊。