General information
Title:
Send updates using SPT to SQL Server
TableUpdate() returns .T. but my remote table isn't updated, somethimes the error 'No update tables are specified' is in the AERROR().
I am new in this stuff so could please someone tell me why this code doesn't update my remote table? (VFP 5.0 & SQL Server 7.0)
SET MULTILOCKS ON
n=SQLCONNECT('Crime')
sqlsetprop(n,'DispWarnings',.T.) &&I don't get errormessages
SQLSETPROP(n,'Transactions',1)
SQLSETPROP(n,'BatchMode',.F.)
SQLSETPROP(n,'Asynchronous',.F.)
var=sqlexec(n,"select * from titles where titDescr like '%PIRATE%'","test")
var=sqlmoreresults(n)
replace titDescr with 'testestestest'
brow &&Replacement in cursor succeeded
var=cursorsetprop('Buffering',5,'test')
var=cursorsetprop('sendupdates',.t.,'test')
var=cursorsetprop('tables','titles','test')
var=cursorsetprop('keyfieldlist','titId','test')
var=cursorsetprop('updatenamelist','titDescr titDescr','test')
var=cursorsetprop('updatablefieldlist','titId, titDescr','test')
if tableupdate()
messagebox('update succeeded!!!') &&update always succeeds
endif
sqlcommit(n)
var=sqlexec(n,"select * from titles where titDescr like '%PIRATE%'","test2")
sqlmoreresults(n)
if grpnaam = 'testestestest'
messagebox('updated in remote table')&&Never seen this messagebox working
endif
brow
use in test
use in test2
sqldisconnect(n)
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only