Difference between revisions of "Python - MS ADO"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (New page: = ado.py = This script was used to access a LoadRunner Access database repository. <pre> import time import win32com.client engine = engine = win32com.client.Dispatch("DAO.DBEngine.36")...) |
PeterHarding (talk | contribs) |
||
Line 1: | Line 1: | ||
= ado.py = | = Python and ActiveX Data Objects (ADO) = | ||
= References = | |||
* [http://www.ecp.cc/pyado.html] | |||
= Examples = | |||
== ado.py == | |||
This script was used to access a LoadRunner Access database repository. | This script was used to access a LoadRunner Access database repository. |
Revision as of 15:35, 9 November 2007
Python and ActiveX Data Objects (ADO)
References
Examples
ado.py
This script was used to access a LoadRunner Access database repository.
import time import win32com.client engine = engine = win32com.client.Dispatch("DAO.DBEngine.36") db = engine.OpenDatabase(r"c:\lr\py\analysis.mdb") rs = db.OpenRecordset("Result") while not rs.EOF: scenario = rs.Fields("Scenario Name").Value name = rs.Fields("Result Name").Value tz = rs.Fields("Time Zone").Value / 3600 startTime = rs.Fields("Start Time").Value endTime = rs.Fields("Result End Time").Value rs.MoveNext() print print " Scenario: %s " % scenario print " Run ID: %s " % name print " TZ: %s " % tz print "Start Time: %s " % time.asctime(time.localtime(startTime)) print " End Time: %s " % time.asctime(time.localtime(endTime))