Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter not inserting all the updated fields.
Message
From
29/05/2007 14:16:29
 
 
To
27/05/2007 14:21:54
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01228666
Message ID:
01229124
Views:
34
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform