【脚本语言系列】关于Python数据库访问DAO, 你需要知道的事
来源:互联网 发布:淘宝客服售后用语大全 编辑:程序博客网 时间:2024/06/04 19:20
如何使用DAO
# -*- coding:utf-8 -*-import win32com.clientengine = win32com.client.Dispatch("DAO.DBEngine.36")db = engine.OpenDatabase(r"addresses.mdb")rs = db.OpenRecordset("address")rs = db.OpenRecordset("select * from address")# insert the datadb.Execute('''insert into address(name, address, createtime)values("am","shanghai","1990-01-01")''')while not rs.EOF: print (rs.Fields("address").Value).encode("utf-8") rs.MoveNext()
----------------------------------------------------------------------com_error Traceback (most recent call last)<ipython-input-7-be7d7f19dd76> in <module>() 4 engine = win32com.client.Dispatch("DAO.DBEngine.36") 5 db = engine.OpenDatabase(r"addresses.mdb")----> 6 rs = db.OpenRecordset("address") 7 rs = db.OpenRecordset("select * from address") 8 # insert the datac:\python27\lib\site-packages\win32com\client\dynamic.pyc in OpenRecordset(self, Name, Type, Options, LockEdit)com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3', (0, u'DAO.Database', u"Microsoft Jet \u6570\u636e\u5e93\u5f15\u64ce\u627e\u4e0d\u5230\u8f93\u5165\u8868\u6216\u67e5\u8be2 'address'\u3002 \u786e\u5b9a\u5b83\u662f\u5426\u5b58\u5728\uff0c\u4ee5\u53ca\u5b83\u7684\u540d\u79f0\u7684\u62fc\u5199\u662f\u5426\u6b63\u786e\u3002", u'jeterr40.chm', 5003078, -2146825210), None)
什么是DAO
DAO(Data Access Object)具有面向对象的接口,提供了Microsoft Jet数据库引擎。
DAO模型是设计关系数据库系统结构的对象类的集合。
阅读全文
0 0
- 【脚本语言系列】关于Python数据库访问DAO, 你需要知道的事
- 【脚本语言系列】关于Python数据库访问ActiveXDataObject,你需要知道的事
- 【脚本语言系列】关于Python数据库访问专用模块,你需要知道的事
- 【脚本语言系列】关于Python系统管理,你需要知道的事
- 【脚本语言系列】关于Python容器,你需要知道的事
- 【脚本语言系列】关于Python数据库处理SQLite数据库,你需要知道的事
- 【脚本语言系列】关于Python数据库处理SQLite,你需要知道的事
- 【脚本语言系列】关于Python数据库处理MySQL, 你需要知道的事
- 【脚本语言系列】关于Python数据库编程ODBC,你需要知道的事
- 【脚本语言系列】关于Python数据库处理SQLAlchemy,你需要知道的事
- 【脚本语言系列】关于PythonWeb访问urllib,你需要知道的事
- 【脚本语言系列】关于PythonWeb访问ftplib,你需要知道的事
- 【脚本语言系列】关于PythonNoSQL数据库处理dbm,你需要知道的事
- 【脚本语言系列】关于PythonNoSQL数据库处理memcached,你需要知道的事
- 【脚本语言系列】关于PythonNoSQL数据库处理redis,你需要知道的事
- 【脚本语言系列】关于Python调试报错,你需要知道的事
- 【脚本语言系列】关于Python开发环境搭建,你需要知道的事
- 【脚本语言系列】关于Python数值计算NumPy, 你需要知道的事
- Oracle学习笔记(二)
- DEDECMS模板建站:中小企业建站首选织梦模板之家
- 算法设计与应用基础:第十六周
- Android jni 回调Java层函数方法
- CKEditor图片上传实现详细步骤(使用Struts 2)
- 【脚本语言系列】关于Python数据库访问DAO, 你需要知道的事
- 计蒜客————罗马数字转换成整数
- 二级联动、三级联动
- 安装Composer与laravel安装
- Log4J日志配置详解
- 线程第二章
- (002) java后台开发之对象初始化
- java中解析xml文件的两种方式
- Linux strace、pstack 命令 使用详解