********************************************************************* Local lnHandle, lcDatabaseName, lcCommand,ix lcDatabaseName = "myTestData" lnHandle=Sqlstringconnect('DRIVER=SQL Server;SERVER=servername;Trusted_connection=Yes') If SQLExec(m.lnHandle, "create database "+m.lcDatabaseName) < 0 Do errHand Return Endif mySQLExec(m.lnHandle, "use "+m.lcDatabaseName) TEXT to m.lcCommand noshow CREATE TABLE [dbo].[test_guid] ( [test_guid_id] uniqueidentifier ROWGUIDCOL NOT NULL , [a] char(10) NULL , [b] char(10) NULL , [bit1] bit NOT NULL , [timestamp_column] timestamp NULL ) ON [PRIMARY] ENDTEXT mySQLExec(m.lnHandle, m.lcCommand) mySQLExec(m.lnHandle,'select top 0 test_guid_id,bit1 from test_guid','v_test') && returns 1 and i get an empty cursor. same if used where 1=2 instead of top 0 * Make SPT cursor an updatable cursor <---------------------------- Check these part CursorSetProp('KeyFieldList','test_guid_id','v_test') CursorSetProp('WhereType',1,'v_test') CursorSetProp('Tables','test_guid','v_test') CursorSetProp("UpdateNameList", ; "test_guid_id test_guid.test_guid_id,"+; "bit1 test_guid.bit1",'v_test') CursorSetProp('UpdatableFieldList','test_guid_id,bit1','v_test') CursorSetProp('SendUpdates',.T.,'v_test') CursorSetProp('Buffering',5,'v_test') * Make SPT cursor an updatable cursor <---------------------------- Check these part * Generate 5 GUID using SQL server's NewID() function mySQLExec(m.lnHandle,"select top 5 NewID() as cGUID from pubs..authors","GUIDVal") Select GUIDVal Scan Insert Into v_test Values (GUIDVal.cGUID,.T.) && value gets inserted locally. Endscan ? Tableupdate(2,.T.,'v_test') && Tableupdate to send updates mySQLExec(m.lnHandle,'select * from test_guid','CheckResult') SQLDisconnect(m.lnHandle) Select CheckResult Browse Title 'After Update' Function mySQLExec Lparameters tnHandle, tcSQL, tcCursorName tcCursorName = Iif(Empty(tcCursorName),'',tcCursorName) If SQLExec(tnHandle,tcSQL,tcCursorName) < 0 Do errHand With tcSQL Endif Function errHand Lparameters tcSQL lcError=tcSQL+Chr(13) Aerror(arrCheck) For ix=1 To 7 lcError = lcError+Trans( arrCheck [ix])+ Chr(13) Endfor Messagebox(lcError,0,'Error def.') *********************************************************************Cetin