Attachment 'exesql.py'
Download 1 import win32com.client
2 import pywintypes
3 from isql2 import Aisql
4 import cmd
5 def connect(dbfn):
6 try:
7 constr=r"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+dbfn+";Persist Security Info=False"
8 print constr
9 db=Aisql()
10 db.dbConnect("",constr)
11 return(db)
12 except pywintypes.com_error,e:
13 print e[0],e[1]
14 except:
15 print "error"
16 if __name__=="__main__":
17 dbfn=r"J:\nb\cs\access2000\data.mdb"
18 db=connect(dbfn)
19 if db!=None:
20 for cmd1 in cmd.cmds:
21 try:
22 r=db.execQuery(cmd1)
23 except pywintypes.com_error,e:
24 if e[0]==-2147352567:
25 pass
26 else:
27 print e[0],e[1]
28 else:
29 print "error open"
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.