[Gambas-user] Database update

Charlie Reinl Karl.Reinl at ...9...
Sat Mar 10 11:47:52 CET 2007


Salut Steven,

your rsD have be prepared by a create for an new or a edit when 
Working with an existing resultset. 

ex: 
	
 rsD = myConnection.Create("myTable")
or        
 rsD = myConnection.Edit("myTable", "ID = &1", iId)

' here you change the fields values

'then you fire  
rsD.update()
-- 
Amicalment
Charlie
Am Samstag, den 10.03.2007, 08:05 +0100 schrieb Steven Lobbezoo:
> Hi,
> 
> I'm setting up my first app with a database.
> All works just fine, but i'm stuck with the update :
> 
> I do :
> DIM rsD as result
> 
> PUBLIC SUB Button1_Click()
> DIM rfield AS ResultField
> DIM ctrl AS Control
> DIM Lbox AS ComboBox
> DIM MySw AS Integer = FALSE
> 
>   'let's see if we want to update
>   FOR EACH ctrl IN ME.Controls
>       IF Object.Type(ctrl) = "TextBox" THEN 
>         IF Object.GetProperty(ctrl, "Text") THEN
>           IF Object.GetProperty(ctrl, "Text") <> 
> Object.GetProperty(ctrl, "Tag") THEN 
>             MySw = TRUE
>             message.Info(rsD[Object.GetProperty(ctrl, "Name")])
> 
>             rsD[Object.GetProperty(ctrl, "Name")] = 
> Object.GetProperty(ctrl, "Text") ' move it in
> 
>           END IF
>         END IF 
>       END IF       
>   NEXT
>   IF MySw = TRUE THEN  
>     IF rsD THEN 'we have red something
>       rsD.update()
>     ELSE ' we migth want to add something
>     
>     END IF
>   END IF
>   ME.Close  
> END
> 
> ---------------------------------
> Whatever, gambas tells me that "Result is read-only".
> In the doc is says that Result is read/write
> 
> How comes ?
> 
> Thanks, Steven
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 






More information about the User mailing list