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
查看全文
相关阅读:
Linux基础之-正则表达式(grep,sed,awk)
Linux基础之-利用shell脚本实现自动监控系统服务
Linux基础之-网络配置,主机名设置,ssh登陆,scp传输
Linux基础之-Bash命令优先级
Linux基础之命令练习Day7-nginx,nfs
Linux基础之命令练习Day4-fdisk,mkfs,mlabel,mount,umount,mkswap,swapon,dd,top,free,ps,kill,rpm,yum,make
Linux基础之命令练习Day3-文件管理:cat,tar,gzip,vim,ln
Linux基础之命令练习Day2-useradd(mod,del),groupadd(mod,del),chmod,chown,
按二次返回键退出
注册用户倒计时
原文地址:https://www.cnblogs.com/cpper/p/1503888.html
最新文章
报错:HTTP Status 404
报错:java.lang.IllegalStateException: Cannot call sendError() after the response has been committed(待解答)
关于路径分隔符:正斜线/、反斜线、双反斜线\的区别
报错:java.io.FileNotFoundException: (系统找不到指定的路径。)
报错:Caused by: java.io.FileNotFoundException: d:youTemprepositoryupload_77faffc1_1580a9240ca__8000_00000001.tmp (系统找不到指定的路径。)
Eclipse无法进入Debug模式
class对象不太明白(待解答)
标签结束问题
JSP里的c:url中的/代表站点根目录还是WEB根目录?(待解答)
java连接数据库(经常用)
热门文章
myeclipse使用技巧
servlet中文乱码处理
给自增长的主键关联外键
在与SQLServer建立连接时出现与网络相关的或特定于实例的错误/通过端口 1433 连接到主机 127.0.0.1 的 TCP/IP 连接失败。错误:“Connection refused: connect
javamail中的 javax.mail.AuthenticationFailedException: failed to connect的解决
sql自增长和占位符?"相矛盾"的问题
在Myeclipse中拷贝一个web项目,但是tomcat文件夹中没有更新,需要进行修改才能更新。
解决使用myeclipse电脑卡的问题
HBase连接数据库(集群)
Linux基础之-shell script(变量,运算符,流程控制,函数)
Copyright © 2011-2022 走看看