I have the first experience with vfp 8.0 Beta and CursorAdapter.
I've tried to update a remote Table on SQL SERVER using a Cursor Adapter Object.
The code below is the code that i used.
I have some problem with UPDATETYPE properties on CursorObject.
Infact even if i assign explicity UPDATETYPE=1 (should be default) the Cursor Adapter have the same behaviour as UPDATETYPE=2.
I've discovered this because the TABLEUPDATE fails when SQL SERVER try to delete the record, infact my table (ABICAB) is a Parent table and if i try to update a record that is referenced the UPDATE FAILS.
Where i can report this Bug ?
SomeOne can help me to verify this beavhior (my english is very poor).
Why when i try to catch on sql profiler the update commands sent to server by CursorAdapter, the profiler don't catch update command ?
** Cut Here
SQLSETPROP(0, 'displogin', 1)
nHandle = SQLSTRINGCONNECT('DRIVER=SQL SERVER;SERVER=WXP04;APP=Microsoft Visual FoxPro;WSID=WXP04;DATABASE=MyDemo;Trusted_Connection=Yes')
IF nhandle <=0
RETURN
ENDIF
o = NEWOBJECT('CursorAdapter')
o.DatasourceType = "ODBC"
o.Datasource = nHandle
o.SelectCmd = "SELECT * FROM AbiCab2 WHERE Cd_AbiCab LIKE '01%'"
o.Alias = 'AbiCab2'
o.buffermodeoverride = 5
o.Tables = 'AbiCab2'
o.KeyFieldList = 'Id_AbiCab'
o.updatablefieldlist = 'Descrizione'
o.updatenamelist = 'id_AbiCab AbiCab2.id_AbiCab, Descrizione AbiCab2.Descrizione'
o.SendUpdates = .t.
o.allowupdate = .t.
o.allowdelete = .t.
o.allowinsert = .t.
o.updatetype = 1
if o.CursorFill()
SELECT (o.Alias)
** During Browser i modified some descriptions
BROWSE NORMAL
IF !TABLEUPDATE(1, .T., o.Alias)
aerror(laErrors)
messagebox(laErrors[2])
ENDIF
o.cursorRefresh()
BROWSE NORMAL
else
aerror(laErrors)
messagebox(laErrors[2])
endif
RELEASE o
RETURN
** Cut Here
bye, Emanuele!
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.