zoukankan
html css js c++ java
python访问ACCESS
Code
1
'''
2
py 访问 ACCESS
3
'''
4
import
win32com.client
5
import
urllib
6
import
time
7
8
(a,b)
=
urllib.urlretrieve(
'
http://chenluqq.googlepages.com/webmail_verification.mdb
'
)
9
print
a
10
time.sleep(
30
)
11
print
b
12
13
conn
=
win32com.client.Dispatch(r
'
ADODB.Connection
'
)
14
DSN
=
'
PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=%s;
'
%
(a)
15
conn.Open(DSN)
16
rs
=
win32com.client.Dispatch(r
'
ADODB.Recordset
'
)
17
rs_name
=
'
select * ,expire-date() as havedays from webmail_sohu_verification where serialno=\
'
6200002DAH0C65N8\
''
18
rs.Open(rs_name, conn,
1
,
3
)
19
'''
20
for x in range(rs.Fields.Count):
21
print rs.Fields.Item(x).Value
22
'''
23
24
serialno
=
rs.Fields.Item(
'
serialno
'
).Value
25
code
=
rs.Fields.Item(
'
code
'
).Value
26
remark
=
rs.Fields.Item(
'
remark
'
).Value
27
Pid
=
rs.Fields.Item(
'
Pid
'
).Value
28
expire
=
rs.Fields.Item(
'
expire
'
).Value
29
havedays
=
int(rs.Fields.Item(
'
havedays
'
).Value)
30
print
serialno,code,remark,Pid,expire,havedays
31
32
'''
33
print rs.Fields.Item(x).Name
34
print rs.Fields.Item(x).Value
35
print rs.Fields.Item(1).DefinedSize
36
'''
37
38
rs.close
39
conn.close
40
查看全文
相关阅读:
出栈序列的可能性判定
阿里离线数据处理平台2013暑期学校
终于算完了这道『1+1』
数据结构学习笔记之一 链表
经典解释监视器和对象锁
Sybase中字符串替换函数 STR REPLACE
使用Arrays sort 方法進行排序
clustered和nonclustered索引的区别
Java序列化的作用和反序列化
Java多线程下载并具断点续传功能JAR
原文地址:https://www.cnblogs.com/cpper/p/1503888.html
最新文章
斜率优化
[BZOJ2964]Boss单挑战
[BZOJ1880][Sdoi2009]Elaxia的路线
[BZOJ3653]谈笑风生
iOS 编译Undefined symbols报错问题
编辑器场景打包资源
C# 中 ref,out, params 解析
Unity中Awake与Start函数的调用情况总结(转)
unity中使用代理(翻译)
iOS开发工具系列
热门文章
网页表单多条数据的数组传递方式
外键和内外左右连接的基础知识
12款精品上瘾iOS游戏
Mac的GUI哲学
《写给大家看的设计书》
给女朋友的礼物
《清单革命》
《俞敏洪口述》
定制Octopress
给博客签上CC协议
Copyright © 2011-2022 走看看