Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter not inserting all the updated fields.
Message
From
27/05/2007 14:21:54
 
 
To
25/05/2007 23:07:56
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01228666
Message ID:
01228777
Views:
34
Hi John,

I am not able to reproduce the problem that you are describing.
The following code works for me as expected:
CLEAR

conn=SQLCONNECT("LocalServer")
?conn

TEXT TO cSQL NOSHOW
CREATE TABLE #ContactsLU
(
    ID              Int,
    ROOTID          Int,
    CONTACTID       Int,
    PARENTID        Int,
    TYPE            Char(2),
    NAME            Char(40)
)
ENDTEXT

?SQLEXEC(conn,cSQL)

LOCAL oCA as CursorAdapter 

oCA = CREATEOBJECT("CATestInsert")
oCA.Alias="ContactsLU"
oCA.SelectCmd="Select * from #ContactsLU"
oCA.UpdatableFieldList = "ID, ROOTID, CONTACTID, PARENTID, TYPE, NAME"
oCA.UpdateNameList="ID #ContactsLU.ID, ROOTID #ContactsLU.ROOTID,"+;
	"CONTACTID #ContactsLU.CONTACTID, PARENTID #ContactsLU.PARENTID,"+;
	"TYPE #ContactsLU.TYPE, NAME #ContactsLU.NAME"
oCA.Tables="#ContactsLU"
oCA.DataSourceType="ODBC"
oCA.DataSource=conn

IF !oCA.CursorFill()
	AERROR(aerrs)
	DISPLAY MEMORY LIKE aerrs
ENDIF
SELECT ContactsLU 

INSERT INTO ContactsLU (RootId,ParentId,Type,Name) VALUES (234,243,"CN","Test2")
lx=TABLEUPDATE()
?lx

SQLDISCONNECT(conn)

  DEFINE CLASS CATestInsert AS CursorAdapter  
  	PROCEDURE BeforeInsert   
  		LPARAMETERS cFldState, lForce, cInsertCmd  
  		?  
  		? PROGRAM()  
  		? "cInsertCmd=",cInsertCmd  
  	ENDPROC   
  ENDDEFINE  
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform