Trying to set a date field in a access databse

Roger Upole rupole at hotmail.com
Fri Nov 7 12:58:54 EST 2008


You should be able to pass a PyTime or datetime.datetime object.

            Roger

<tedpottel at gmail.com> wrote in message 
news:12d9f626-9e5c-484a-94e4-120122a41214 at 40g2000prx.googlegroups.com...
> Hi,
> I cannot get the following code to work
>
> import win32com.client
> import time
>
> engine = win32com.client.Dispatch("DAO.DBEngine.36")
> db=engine.OpenDatabase(r"testdate2.mdb")
> access = db.OpenRecordset("select * from test")
>
> access.AddNew()
> access.Fields("test").value=time.strptime('10:00AM', '%I:%M%p')
> access.Update()
>
> wherer test is a datetime field,
> How can I do this???????
> -Ted
>
> --
> http://mail.python.org/mailman/listinfo/python-list
> 






More information about the Python-list mailing list