B4J Question B4J and Database ACCESS save the data(solved)

bjfhs

Active Member
Licensed User
I can read data from Access,but when use update,
B4X:
     sql.BeginTransaction
    sql.ExecNonQuery("update timu set zd=true where xh ='" & xh & "'")
    sql.TransactionSuccessful
When I close the software,and open the mdb with Access 2010,I find the data doesn't change.
I know in VB6,you must use sql.update to make the data real change.How can I do with B4J?
 

bjfhs

Active Member
Licensed User
Better:
B4X:
sql.ExecNonQuery("update timu set zd=true where xh = ?", Array(xh))
Are you sure that the criteria is met? What happens if you insert data?

Are you closing the SQL object at some point?
After I insert data,I can read it with sql.ExecQuery,but when I close my software,and open the mdb with Access2010,I can't find the new data.
I close the SQL object when closing the software.
B4X:
   Sub MainForm_CloseRequest (EventData As Event)
       sql.Close
   End Sub
 
Top