Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: anand kulkarni
  Where is anand kulkarni?
 sholapur
 India
 anand kulkarni
 Tags
Subject: RE: gride refresh
Thread ID: 209684 Message ID: 209731 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Tuesday, December 30, 2008 4:28:21 PM         
   


> >
> > Are you using buffering? What commands are you using to update and insert the backend tables?
> > Have you set any properties for the SPT result cursor using CursorSetProp()?
> >
> > -Anders
>
>
> hi
> sqlcommit and tabalupdate(.t.) any thing woring
> regards
> anand


'Remote views' work with TableUpdate() and REQURY('viewname') if the Update Criteria in the View Designer has been filled in.
SPT cursors, returned by SQLEXEC() calls, require you to set up five cursor properties with CURSORSETPROP()
CursorSetProp('KeyFieldList', key fields list, 'Cursorname') 
CursorSetProp('Tables', ...,'cursorname')
CursorSetProp('SendUpdates, .T., 'cursorname')
CursorSetProp('UpdateableFieldList', ... )
CursorSetProp('UpdateNameList', ...)
and if you need also
CursorSetProp('UpdateType',...)
CursorSetProp('WhereType',...)


Then TableUpdate() will work.
The alternative is to examine the row with GETFLDSTATE(-1, 'cursorname) in the Grid's BeforeRowColChange event and then use
SQLEXEC(handle, 'UPDATE table SET column = newvalue') 
* or  
SQLEXEC(handle, 'INSERT INTO table VALUES (....)') 


If the grid's RecordSource cursor is table buffered, you can save all the updating till later and use
 GETNEXTMODIFIED() 

to find all the modified rows and then proceed to UPDATE or INSERT with SQLEXEC() based on what GETFLDSTATE() returns.

-Anders

ENTIRE THREAD

gride refresh Posted by anand kulkarni @ 12/30/2008 1:32:10 PM
RE: gride refresh Posted by Anders Altberg @ 12/30/2008 1:44:02 PM
RE: gride refresh Posted by anand kulkarni @ 12/30/2008 2:36:52 PM
RE: gride refresh Posted by Anders Altberg @ 12/30/2008 4:28:21 PM
RE: gride refresh Posted by anand kulkarni @ 12/31/2008 1:07:03 PM
RE: gride refresh Posted by Anders Altberg @ 1/1/2009 12:52:57 PM
RE: gride refresh Posted by anand kulkarni @ 1/12/2009 7:09:41 AM
RE: gride refresh Posted by surinder singh @ 1/13/2009 3:26:18 PM
RE: gride refresh Posted by anand kulkarni @ 1/23/2009 6:42:58 AM
RE: gride refresh Posted by tushar @ 12/30/2008 2:49:37 PM
RE: gride refresh Posted by anand kulkarni @ 12/31/2008 12:46:29 PM
RE: gride refresh Posted by tushar @ 1/1/2009 6:01:39 AM
RE: gride refresh Posted by anand kulkarni @ 1/12/2009 6:42:05 AM
RE: gride refresh Posted by Anders Altberg @ 1/1/2009 1:15:01 PM