Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue May 22, 2018 10:22 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: RB Update SQL SERVER Database Record
PostPosted: Mon Apr 08, 2013 6:05 am 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
Hi

I can't find any example in the LR for updating a database record.

This code works fine for creating my Table and fields

Dim sql As String
sql = "CREATE TABLE Team (ID INTEGER NOT NULL, Name TEXT, Coach TEXT, City TEXT, PRIMARY KEY(ID));"
DB.SQLExecute(sql)


Looking for a RB sql statement to "Update Table Team -> 'Coach' -> WHERE 'ID'= "8"

Thanks

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: RB Update SQL SERVER Database Record
PostPosted: Mon Apr 08, 2013 7:35 am 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
UPDATE Team SET Coach = 'New_Value' WHERE ID = 8

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: RB Update SQL SERVER Database Record
PostPosted: Mon Apr 08, 2013 7:53 am 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
Thanks mark :wink:

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: RB Update SQL SERVER Database Record
PostPosted: Mon Apr 08, 2013 12:37 pm 
Offline
User avatar

Joined: Sun Jan 25, 2009 5:11 pm
Posts: 576
Location: Guatemala, Central America
The previous answer is the most efficient way, however you could also do something like:

rs.edit
rs.field("yourfield").stringvalue = "something here"
rs.update
rs.commit


But again, the previous answer is faster.

_________________
Future RS guru.
Ride the world!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group