Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursoradapter and tableupdate
Message
 
To
12/10/2007 00:27:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01260455
Message ID:
01260519
Views:
20
Thats interesting. Can you change buffering on the fly in runtime for a CA or are you required to do it in design mode?

>Hi Maximo
>
>>>CURSORSETPROP( "Buffering",5,"curcustomerlevel")
>
>You are setting the Buffering of the resultant cursor, after it is created.
>
>What you should do is set the Buffering on the CuursorAdapter Class. Open the CA class and set the property:
>
>BufferModeOverride = 5(Optimistic Table Buffering)
>
>That is all.
>
>
>
>
>>Hi Bernard
>>I used
>>PUBLIC oCustomerLevel
>>oCustomerLevel = CREATEOBJECT("cacustomerlevel")
>>oCustomerLevel.CursorFill()
>>CURSORSETPROP( "Buffering",5,"curcustomerlevel")
>>
>>But it has no effect,
>>after doing a
>>REPLACE ALL leveldiscountpercent WITH 1
>>updates are sent inmediately and tablerevert(.t.) does not have any effect.
>>
>>
>>
>>>Set Buffering to 5. Then when you want to save issue TABLEUPDATE()
>>>
>>>>Hi all
>>>>
>>>>I need to update some SQL Server tables and remembered the cursoradapter.
>>>>Using the CA builder I got a cursoradapter and I'm able to fill the cursor, browse, make changes and those changes are sent and update my SQL Server test table.
>>>>So far so good.
>>>>
>>>>But the behavior I want is to be able to make changes in the local cursor BUT send the updates only after a Tableupdate(). Not automatically as it is happening now.
>>>>
>>>>How do I do that?
>>>>Here is the code from the CA builder, many thanks in advance,
>>>>
>>>>
>>>>
>>>>PUBLIC oCustomerLevel
>>>>oCustomerLevel = CREATEOBJECT("cacustomerlevel")
>>>>oCustomerLevel.CursorFill()
>>>>Browse
>>>>*-- Make some changes here
>>>>*-- Those are sent inmediately to the SQL Server table!
>>>>*-- I want to 'push' the changes with tableupdate() not sending them automatically.
>>>>**************************************************
>>>>*-- Class:        cacustomerlevel (c:\documents and settings\mzambrano\my documents\campuscare 2007\vfpcode\aspdotnetstorefront.vcx)
>>>>*-- ParentClass:  cursoradapter
>>>>*-- BaseClass:    cursoradapter
>>>>*-- Time Stamp:   10/11/07 05:47:00 PM
>>>>*
>>>>DEFINE CLASS cacustomerlevel AS cursoradapter
>>>>
>>>>
>>>>	Tag = "Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=XXXXX;Data Source=YYYY;"
>>>>	Height = 22
>>>>	Width = 23
>>>>	SelectCmd = "select * from CustomerLevel"
>>>>	CursorSchema = "CUSTOMERLEVELID I, CUSTOMERLEVELGUID C(38), NAME M, LEVELDISCOUNTPERCENT Y, " + ;
>>>>		"LEVELDISCOUNTAMOUNT Y, LEVELHASFREESHIPPING I, LEVELALLOWSQUANTITYDISCOUNTS I, LEVELHASNOTAX I," + ;
>>>>		" LEVELALLOWSCOUPONS I, LEVELDISCOUNTSAPPLYTOEXTENDEDPRICES I, LEVELALLOWSPO I, DISPLAYORDER I," + ;
>>>>		" PARENTCUSTOMERLEVELID I, SENAME C(100), EXTENSIONDATA M, DELETED I, CREATEDON T, SKINID I, TEMPLATENAME C(50)"
>>>>	Alias = "curcustomerlevel"
>>>>	DataSourceType = "ADO"
>>>>	Flags = 0
>>>>	FetchSize = -1
>>>>	KeyFieldList = "CUSTOMERLEVELID"
>>>>	Tables = "CustomerLevel"
>>>>	
>>>>	
>>>>	
>>>>	UpdatableFieldList = "CUSTOMERLEVELGUID, NAME, LEVELDISCOUNTPERCENT, LEVELDISCOUNTAMOUNT, LEVELHASFREESHIPPING,"+;
>>>>	" LEVELALLOWSQUANTITYDISCOUNTS, LEVELHASNOTAX, LEVELALLOWSCOUPONS, LEVELDISCOUNTSAPPLYTOEXTENDEDPRICES," + ;
>>>>	" LEVELALLOWSPO, DISPLAYORDER, PARENTCUSTOMERLEVELID, SENAME, EXTENSIONDATA, DELETED, CREATEDON, SKINID," + ;
>>>>	" TEMPLATENAME"
>>>>	
>>>>	UpdateNameList = "CUSTOMERLEVELID CustomerLevel.CUSTOMERLEVELID, CUSTOMERLEVELGUID CustomerLevel.CUSTOMERLEVELGUID, " + ;
>>>>		"NAME CustomerLevel.NAME, LEVELDISCOUNTPERCENT CustomerLevel.LEVELDISCOUNTPERCENT, " + ;
>>>>		"LEVELDISCOUNTAMOUNT CustomerLevel.LEVELDISCOUNTAMOUNT, LEVELHASFREESHIPPING " + ;
>>>>		"CustomerLevel.LEVELHASFREESHIPPING, LEVELALLOWSQUANTITYDISCOUNTS " + ;
>>>>		"CustomerLevel.LEVELALLOWSQUANTITYDISCOUNTS, LEVELHASNOTAX CustomerLevel.LEVELHASNOTAX," + ;
>>>>		" LEVELALLOWSCOUPONS CustomerLevel.LEVELALLOWSCOUPONS, LEVELDISCOUNTSAPPLYTOEXTENDEDPRICES " + ;
>>>>		"CustomerLevel.LEVELDISCOUNTSAPPLYTOEXTENDEDPRICES, LEVELALLOWSPO CustomerLevel.LEVELALLOWSPO," + ;
>>>>		" DISPLAYORDER CustomerLevel.DISPLAYORDER, PARENTCUSTOMERLEVELID CustomerLevel.PARENTCUSTOMERLEVELID," + ;
>>>>		" SENAME CustomerLevel.SENAME, EXTENSIONDATA Address.EXTENSIONDATA, DELETED Address.DELETED, " + ;
>>>>		"CREATEDON Address.CREATEDON, SKINID CustomerLevel.SKINID, TEMPLATENAME CustomerLevel.TEMPLATENAME"
>>>>		
>>>>	Name = "cacustomerlevel"
>>>>
>>>>
>>>>	PROCEDURE Init
>>>>		*** Setup code: DO NOT REMOVE
>>>>		local llReturn
>>>>		do case
>>>>			case not pemstatus(This, '__VFPSetup', 5)
>>>>				This.AddProperty('__VFPSetup', 0)
>>>>			case This.__VFPSetup = 1
>>>>				This.__VFPSetup = 2
>>>>			case This.__VFPSetup = 2
>>>>				This.__VFPSetup = 0
>>>>				return
>>>>		endcase
>>>>		set multilocks on
>>>>		llReturn = dodefault()
>>>>		*** End of Setup code: DO NOT REMOVE
>>>>		*** Select connection code: DO NOT REMOVE
>>>>
>>>>		local loConnDataSource
>>>>		loConnDataSource = createobject('ADODB.Connection')
>>>>		***<DataSource>
>>>>		loConnDataSource.ConnectionString = [Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;In] + ;
>>>>			[itial Catalog=AspDotNetStorefront;Data Source=mossfarm;]
>>>>		***</DataSource>
>>>>		loConnDataSource.Open()
>>>>		This.DataSource = createobject('ADODB.RecordSet')
>>>>	
>>>>		THIS.DATASOURCE.CursorType			= 3  && adOpenStatic
>>>>		
>>>>		This.DataSource.CursorLocation   = 3  && adUseClient
>>>>		This.DataSource.LockType         = 3  && adLockOptimistic
>>>>		This.DataSource.ActiveConnection = loConnDataSource
>>>>		*** End of Select connection code: DO NOT REMOVE
>>>>
>>>>		*** Setup code: DO NOT REMOVE
>>>>		if This.__VFPSetup = 1
>>>>			This.__VFPSetup = 2
>>>>		endif
>>>>		return llReturn
>>>>		*** End of Setup code: DO NOT REMOVE
>>>>	ENDPROC
>>>>
>>>>
>>>>	PROCEDURE AutoOpen
>>>>		*** Setup code: DO NOT REMOVE
>>>>		if not pemstatus(This, '__VFPSetup', 5)
>>>>			This.AddProperty('__VFPSetup', 1)
>>>>			This.Init()
>>>>		endif
>>>>		*** End of Setup code: DO NOT REMOVE
>>>>	ENDPROC
>>>>
>>>>
>>>>ENDDEFINE
>>>>*
>>>>*-- EndDefine: cacustomerlevel
>>>>**************************************************
>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform