Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Koen Piller
  Where is Koen Piller?
 Santpoort
 Netherlands
 Koen Piller
 To: ashish mehta
  Where is ashish mehta?
 bhopal
 India
 ashish mehta
 Tags
Subject: RE: update cursor
Thread ID: 288926 Message ID: 288930 # Views: 33 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Sunday, December 26, 2010 10:54:32 PM         
   


> hello,
> statement is
> SELECT VALID1.ENV_CODE,VALID1.PAGENO,VALID1.SUB_CODE,VALID1.TYPE,VALID1.PAPER,VALID1.ROLL_NO;,
> VALID1.MARKS,VALID2.marks FROM valid1 JOIN valid2 ON VALID1.roll_no=VALID2.roll_no;
> .and. valid1.marks<>valid2.marks ;
> INTO CURSOR Q1 READWRITE
> Thisform.pageframe1.page4.Grid3.RecordSource="q1"
>
> problem is, i change in marks value in grid3,i want to update table (valid1 or valid2)
> also, how can i do this?

Hi,

provided the field Roll_no is a valid unique id you could also make use of scatter/gather however you have to change the cursor Q1 fields 'marks' with unique field names.
so e.g.

Select Valid1.env_code,;
	Valid1.PageNo,;
	Valid1.Sub_code,;
	Valid1.Type,;
	Valid1.Paper,;
	Valid1.Roll_No, ;
	Valid1.Marks As Valid1Marks,;  
	Valid2.Marks As Valid2marks ;
From Valid1 ;
	Join Valid2 On Valid1.Roll_No=Valid2.Roll_No .And. Valid1.Marks<>Valid2.Marks ;
Into Cursor Q1 Readwrite


Now you can update table Valid1.marks with value of Q1.Valid1Marks and/or Valid2.marks with Q1.Valid2NMarks

Regards,

Koen

ENTIRE THREAD

update cursor Posted by ashish mehta @ 12/26/2010 7:39:10 PM
RE: update cursor Posted by Stefan Wuebbe @ 12/26/2010 9:11:14 PM
RE: update cursor Posted by ashish mehta @ 12/27/2010 8:07:29 AM
RE: update cursor Posted by Koen Piller @ 12/26/2010 10:54:32 PM
RE: update cursor Posted by ashish mehta @ 12/27/2010 8:08:42 AM