Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Code Generates Error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01010548
Message ID:
01010554
Views:
29
You've to check TABLEUPDATE) return value to make sure that it succeed.

>Not sure whats wrong here. On the second 'BROWSE NORMAL' command I
>get "No key columns are specified for the update table 'dbo.campaign'. Use
>the KeyFieldList property of the cursor"
>
>After this error occurs, I cannot close the table.
>
>
>	SET ESCAPE ON
>	CLOSE DATABASES ALL
>	CLEAR
>
>	LOCAL nHandle, cConnString
>	
>	cConnString = "Driver=SQL Server;Server=(local);Trusted_Connect=Yes;Database=MCM"
>	
>	nHandle = SQLSTRINGCONNECT(cConnString)
>	
>	IF nHandle > 0
>	
>		** Run the query
>		cQuery = "select * from campaign where campid = 'TSR'"
>		nResult = SQLExec(nHandle, cQuery, "CampInfo")
>		BROWSE NORMAL
>		
>		** If no errors occured...
>		IF nResult > 0
>		
>			=CURSORSETPROP("Tables", "dbo.campaign", "CampInfo")
>			=CURSORSETPROP("KeyFieldList", "Id", "CampInfo")
>			=CURSORSETPROP("UpdatableFieldList", "Id, ProdCat", "CampInfo")
>			=CURSORSETPROP("UpdateNameList", "ProdCat dbo.campaign.ProdCat")
>			=CURSORSETPROP("SendUpdates", .T., "CampInfo")
>		
>			SELECT CampInfo
>			REPLACE ProdCat WITH "CHANGED" NEXT 1
>			
>			=TABLEUPDATE(.T.)
>			BROWSE NORMAL
>		
>		ENDIF
>		
>		=SQLDISCONNECT(nHandle)
>		
>	ELSE
>	
>		? "Not connected"
>
>	ENDIF
>
>RETURN
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform