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
Title:
SQL Code Generates Error
Miscellaneous
Thread ID:
01010548
Message ID:
01010548
Views:
57
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
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform