Please help with Python Script/MS-Access (DAO)

Dave dave5774 at hotmail.com
Mon Jun 17 23:59:25 EDT 2002


Thank you Kirby,
I apologize, but I'm not that advanced in Python to know sgml.  I would like
to use more standard commands.  I can use SQL, and I know Python - Access
commands like OpenRecordSet(), TableDefs.count(), Execute(), while not
rs.EOF, Fields().....
Is there any other way to write the program without SGML?  To give you more
of an idea of the way I'd like the program, I wrote another program for
doing a similar thing in Excel, not Access, for a file named sales.txt and
the same 5 columns, but put from a file into 5 columns on excel, and certain
parameters to enter at the beginning... :

ProductID = float(raw_input("Please enter the ProductID: "))
OrderQty = float(raw_input("Please enter the cutoff order quantity: "))
CSV = open('c:/sales.txt','r')
import win32com.client
x1=win32com.client.Dispatch('Excel.Application')
x1.visible=1
x1.Workbooks.Add()
x1.Range("A1").Select()
x1.Range("A1:B1").Value = ("ProductID:",ProductID)
x1.Range("A2:B2").Value = ("OrderQty:",OrderQty)
x1.ActiveCell.Offset(4).Activate()
x1.ActiveCell.Range("A1:E1").Value=("OrderID","OrderDate","RegionID","Produc
tID","OrderQty")
x1.ActiveCell.Offset(2).Activate()
for line in CSV.readlines():
    line=line.rstrip()
inOrderID,inOrderDate,inRegionID,inProductID,inOrderQty = line.split(",")
if float(inProductID) == ProductID:
       if float(inOrderQty) >= OrderQty:
           xl.ActiveCell.Range("A1:E1").Value =
(inOrderID,inOrderDate,inRegionID,inProductID,inOrderQty)
xl.ActiveCell.Offset(2).Activate()

If you could help me out I would highly appreciate it...if you would rather
do this over e-mail I could do that, you can e-mail me at
hobiewon at hotmail.com

Thanks again,
Dave








More information about the Python-list mailing list