> UPDATE ... WHERE vfptable.rowid=excelsheet.somecolumn.value
>
> -Anders
Hi Anders,
I know the VFP update statement but the VBA update statement threw me off.
Now the working VBA test code updates every 2 secs to VFP
Almost done it from VBA Now only need is to test in my environment
Private Sub Workbook_Open()
Application.OnTime Now() + TimeSerial(0, 0, 1), "ThisWorkbook.updatetemp"
End Sub
Private Sub updatetemp()
Dim xi As Integer
Set cnn = CreateObject("ADODB.Connection")
cnn.ConnectionString = "Provider=VFPOLEDB;Data Source=C:\;Exclusive=No"
cnn.Open
With Sheet3.UsedRange
For xi = 1 To .Cells(.Cells.Count).Row
cnn.Execute "Update test set vals = '" & Cells(xi, 2).Value & "' where name = '" & Cells(xi, 1).Value & "'"
Next
End With
cnn.Close
Set cnn = Nothing
Application.OnTime Now() + TimeSerial(0, 0, 2), "ThisWorkbook.updatetemp"
End Sub
the "&" threw me off for sometime. I am still not comfortable passing the values in code as inline addition. Will check with command and parameters oledb Objects later. If this works then That *MUST* work no?
Need Sleep . Almost 1:00 am here
Thanx
Bye
SuhasHegde