> Hi all,
>
> I need to get data from Excel In VFp tables. Data is streaming type updates about 200 Rows and about 20+ columns. Updates are fast in 0.25 secs Over the sat link. What i am trying to do is get the data at atleast 2 secs interval into VFP table.
>
> Tried making the worksheet shared but the problem is that Excel give u a minimum of 5 minutes to save a sheet. I also tried Forcing save of the Sheet with VBA ontime code but that leads to Violations when read into Vfp with "append from" or "import from" code even when making the sheet shared and with VBA ontime save .
>
> Even tried opening the worksheet from another instance of excel but after a few minutes gives error of changes lost dialog( which i dont care even if i loose the changes) and stops updating( might happen the same if i open it from VFP createobject()) I dont know how to open a worksheet readonly and while not activating the VBA ontme saving module
>
> So what i am looking out for is a VBA module using ODBC or OLEDB in to VBA code which Updates the VFP table. Can this be done ? If so any tips or points Or code ..?
>
> TIA
> SuhasHegde
A VBA module to update, insert or delete in a VFP table can be as simple as this example of updating a table called "Temp" with a column "field_name". What you need to add are parameters and keys whose values are fetched from the worksheet, and some event that can trigger the module/macro to run. With SET EXCLUSIVE OFF you'll be able to see the changes happen in VFP.
Sub updatetemp()
Set cnn = CreateObject("ADODB.Connection")
cnn.ConnectionString = "Provider=VFPOLEDB;Data Source=C:\Projekt\Testing;Exclusive=No"
cnn.Open
cnn.Execute " UPDATE Temp SET Field_Name=UPPER(Field_name)"
cnn.Close
Set cnn = Nothing
End Sub