Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter not inserting all the updated fields.
Message
De
27/05/2007 14:21:54
 
 
À
25/05/2007 23:07:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01228666
Message ID:
01228777
Vues:
26
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform