On Wed, Aug 8, 2012 at 2:59 PM, Fabien Bodard <gambas...@gmail.com> wrote:
> Le 8 août 2012 04:49, "Adam Ant" <adamn...@gmail.com> a écrit :
>> The answer is:
>>
> It's create
>> rTable=$hConn.create("Inventory",<some request to get the record you
>> want to update>)
>> IF rTable.Available then
>>   rTable!name=txtName.Text
>>   rTable.Update
>> END IF
>>
>
> Don't open/ close the db each time
>

Yes, sorry Roko (and Fabien), I forgot you were trying to ADD a new row.

So it's really
  rTable=$hConn.Create("Inventory")
  IF rTable.Available then
    rTable!name=txtName.Text
    TRY rTable.Update
    IF ERROR THEN
'       your update failed, possibly because of a duplicate key
    ENDIF
  END IF


Bruce

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to