Writing a VB6 program to update VFP tables. I need to update some date
fields and get the error 'function not implemented' when using syntax such
as:
update table1 set datefield1=ctod('2006/04/16') where criteria1=value1
or
update table1 set datefield1={^2006/04/16} where criteria1=value1
Has anyone had success updating Date fields in a VFP table using the VFP OLE
DB driver?
If so, how?
I will also check in VFP forums, but this seems like an appropriate
newsgroup.
DK - 25 Feb 2008 17:43 GMT
> Writing a VB6 program to update VFP tables. I need to update some date
> fields and get the error 'function not implemented' when using syntax such
[quoted text clipped - 13 lines]
> I will also check in VFP forums, but this seems like an appropriate
> newsgroup.
For one thing "ctod" is not a VB function so your first attempt should
fail at that call.
Your second method works fine for an INSERT clause but not for an
update. I'd let the ADO data provider do the work and assign a value
to a Datetime variable and using that variable in the update.
Dim ADate as datetime
adate = cdate("2006/04/16")
sql = "update table1 set datefield1 = " & adate & " where criteria1 =
" & value1