>I am using 2.6, although I have 7.0(it's a migrataion thing).
>My question:
>Using the sql select statement, is there any way to write to the results, and update the database?
>example
>I have 1000 different locations, with several customers for each location. I want to tag 1 record for each location.
>There are several ways to do this, but I was hoping to discover a way to write directly to the data that meets the criterea. Any help?
If I understand you correctly, yes.
For remote data:
lnHandle = sqlconnect(DSN)
lcSql = "select * from ding where dingno = dingdong"
lnReturn = sqlexec(lnHandle,lcSql,'TMPCUR')
if lnReturn > 0
select tmpcur
cursorsetprop("Tables","dbo.ding")
cursorsetprop("UpdateNameList",cRemoteTables)
cursorsetprop("KeyFieldList","Dingno")
cursorsetprop("UpdatableFieldList",cFields)
cursorsetprop("SendUpdates",.T.)
cursorsetprop("Buffering", 3)
tableupdate(.T.,.T.)
endif
Check cursorsetprop in help for a detailed explanation.
For local data use Booth's example, or create a local view instead of a cursor.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California