New topic: 

Problem Deleting Records

<http://forums.realsoftware.com/viewtopic.php?t=37722>

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        S.Rampling          Post subject: Problem Deleting 
RecordsPosted: Fri Feb 18, 2011 7:00 pm                         
Joined: Sat Jan 08, 2011 4:47 pm
Posts: 81
Location: Sydney, Australia                I am using the following code to 
delete records,
Code:  dim rs as RecordSet =karter.SQLSelect("select 
session1,s1lap1,s1lap2,s1lap3,s1lap4,s1lap5,s1lap6 from practice1")
  if karter.Error then
  msgbox karter.ErrorMessage
  end
  
  rs.DeleteRecord
  karter.Commit

The problem I am having is that there are more than just those columns in the 
practice1 record set and it is deleting them all instead of just the ones in 
the select satement.

Am I doing something wrong or is my code incorrect. 

Thanks Shane   
                             Top                 elChupete          Post 
subject: Re: Problem Deleting RecordsPosted: Fri Feb 18, 2011 7:21 pm           
                      
Joined: Fri Jun 05, 2009 11:50 am
Posts: 201
Location: Hamburg, Germany                rs.deleterecord deletes the whole 
record in th db

same as 
Code:pseudo sql

delete from practice1 where session1 = rs.session1 and s1lap1 = rs.s1lap1 and 
s1lap2 = rs.s1lap2 and s1lap3 = rs.s1lap3 .... and s1lap6 = rs.s1lap6


If you want to set session1,s1lap1,s1lap2,s1lap3,s1lap4,s1lap5,s1lap6 to an 
empty value

Code:update practice1 set session1 = '';
update practice1 set s1lap1 = '';
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to