Changeset 345
- Timestamp:
- 12/13/06 08:04:26
- Files:
-
- trunk/storage/storeado.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/storage/storeado.py
r344 r345 9 9 import win32com.client 10 10 clientobj = win32com.client._get_good_object_ 11 OLERecordset = win32com.client.gencache.GetClassForCLSID('{00000556-0000-0010-8000-00AA006D2EA4}') 12 OLEFields = win32com.client.gencache.GetClassForCLSID('{00000564-0000-0010-8000-00AA006D2EA4}') 11 13 OLEField = win32com.client.gencache.GetClassForCLSID('{00000569-0000-0010-8000-00AA006D2EA4}') 12 14 LCID = 0x0 … … 579 581 # 'conn' is a ConnectionWrapper object, which .Open 580 582 # won't accept. Pass the unwrapped connection instead. 581 res, rows_affected = conn.conn.Execute(query) 582 else: 583 res, rows_affected = conn.Execute(query) 583 conn = conn.conn 584 585 obj = conn._oleobj_.InvokeTypes(6, 0, 1, (9, 0), 586 ((8, 1), (16396, 18), (3, 49)), 587 # *args = 588 query, pythoncom.Missing, -1) 589 res, rows_affected = obj 590 res = OLERecordset(res) 584 591 except pywintypes.com_error, x: 585 592 try: … … 594 601 595 602 # Using xrange(Count) is slightly faster than "for x in resFields". 596 resFields = res.Fields # 3ms 603 resFields = res._oleobj_.InvokeTypes(0, 0, 2, (9, 0), ()) 604 resFields = OLEFields(resFields) 597 605 columns = [] 598 606 for i in xrange(resFields.Count): 599 607 # Wow. Calling this directly (instead of resFields(i)) 600 # results in a 29% speedup for fetch() as a whole.608 # results in a 29% speedup for a 1-row fetch() of 48 fields. 601 609 x = resFields._oleobj_.InvokeTypes(0, LCID, 2, (9, 0), ((12, 1),), i) 602 610 x = OLEField(x) 603 611 604 612 # Wow. Calling these directly (instead of x.Name, x.Type) 605 # results in a 40% speedup for fetch() as a whole.613 # results in a 40% speedup for a 1-row fetch() of 48 fields. 606 614 name = x._oleobj_.InvokeTypes(1100, 0, 2, (8, 0), ()) 607 615 typ = x._oleobj_.InvokeTypes(1102, 0, 2, (3, 0), ())
