Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter not inserting all the updated fields.
Message
De
29/05/2007 14:16:29
 
 
À
27/05/2007 14:21:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01228666
Message ID:
01229124
Vues:
28
Hi Aleksey,

Thanks for checking it out for me. I'll have to expand on your test routine and see at what point it starts to show the error. It may be the data environment causing the problem and not the cursor adapter.

John

>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
Répondre
Fil
Voir

Click here to load this message in the networking platform