I just started using the database component and I can't wrap my head around
how updating entries from my database using db.edit(). I'm using Gambas 3 RC
3 on Ubuntu 11.04 x86.

Here is some code, not an exact excerpt but assume that I have assigned
valid values to each of the values of InputItem and that the entry already
exists in the database. I'm just trying to modify some of the values.


Res = dbconn.edit("items", "itemnumber=&1", InputItem.ItemNumber)   '
inputitem.itemnumber = 4000

Inventory.Begin() 'sqlite3 database

Res!itemnumber = InputItem.ItemNumber ' = integer, 4000
Res!active = InputItem.Active ' = 1
Res!price = InputItem.Price ' = 1000
Res!quantity = InputItem.Quantity ' = 100
Res!description = InputItem.Description ' = "New Entry"

Res.Update()

Inventory.Commit()



So with DB.Debug turned on, this is the output:
sqlite3: 0xa2cd6c8: UPDATE 'items' SET 'description' = 'New Entry' WHERE
itemnumber = 4000

I set a breakpoint and can see that all of the values are good there and not
null. It may be a coincidence but the strings are being updated while the
integers are not with the exception of the itemnumber, which is the primary
key. Any ideas?
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to