[Gambas-user] Gambas DB basic update record example

Rizky Tahara Shita rizky at ...568...
Thu Sep 30 08:00:42 CEST 2004


Iwan Prasetyo wrote:
>  
> 
> 
> 
> -----Original Message-----
> From: gambas-user-admin at lists.sourceforge.net
> [mailto:gambas-user-admin at lists.sourceforge.net] On Behalf Of Rizky Tahara
> Shita
> Sent: Thursday, September 30, 2004 09:38
> To: gambas-user at lists.sourceforge.net
> Subject: Re: [Gambas-user] Gambas DB basic update record example
> 
> Iwan Prasetyo wrote:
> 
>>Dear Gambas user...
>>
>>I need a little help for database basic function on Gambas.
>>I'm using PostgreSQL as the database.
>>
>>Here's I attach my screen shots of what I did.
>>
>>I connected to PostgreSQL, and made it...I can view (or navigating) 
>>using MoveFirst, MoveLast, MoveNext, and MovePrevious. Also with MoveTo...
>>
>>I can add a new record also with this code shown on GambasDB2.JPG.
>>(is it correct way? Pls advise if I'm wrong..but it can be done with 
>>that way).
>>
>>My question is how to edit (or Update) an existed record?
>>It seems I can't do that smoothly as in VB like this:
>>(on active record just simply like)
>>rData!name=XXX
>>rData!Sex="Male"
>>rData.Update
>>
>>Or perhaps anyone here know how to find, addnew record and update and 
>>also delete a record smoothly?
>>
>>That's all...
>>
>>Thanks in advance for your help.
>>Regards,
>> 
>>Iwan Prasetyo
>>----------------------
> 
> 
> hmm... why don't you upgrade your code to SQL statement..
> it's more easy to do that than using rData.Update or something like that...
> 
> learn from my example (DataReportExample) then... you'll find more simple to
> do that with SQL...
> 
> 
> Thx Rizki...
> I did update per one record not global...

use looping and where clause...
so you will have 2 sql syntax
the first one for your looping (usualy select sql)
and the second is inside the looping (usualy the update sql with where 
clause)

i think that your algorithm is still using the recordset.
have you ever tried PHP ??
i learn the PHP syntax and convert the algoritm to gambas and VB

so i never use the .addnew, .edit, .update and something like that again 
(not just in gambas, but in VB too). i always use query to do it... 
believe it, query is fun :)

> Update case only for 1 record which is selected...
> For general update, I'd rather to use update from SQL:)
> 
> Regards,
>  
> Iwan Prasetyo
> ----------------------
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> 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