关于更新 sql db (Lover.db) 中的记录,我一直使用 basic4android。这有效:
SQLLover.ExecNonQuery("UPDATE Profiles SET Mobile ='Nos', " & _
"Name = 'Nme', Sunday = 'SundayX', Monday = 'MondayX', " & _
"Tuesday = 'TuesdayX', Wednesday = 'WednesdayX', Thursday = 'ThursdayX', " & _
" Friday = 'FridayX', Saturday = 'SaturdayX', " & _
"StartTime = 'lblTimeFrom.text', EndTime = 'lblTimeTo.Text' " & _
"WHERE Mobile='07xxxxxxxxx' AND Name='Sam'")
但当然只是用单引号中的数据更新。我想使用一些变量,并尝试过这个;
SQLLover.ExecNonQuery2("Update Profiles SET(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", & _
Array As Object(Nos, Nme, SundayX, MondayX, TuesdayX, WednesdayX, & _
ThursdayX, FridayX, SaturdayX, lblTimeFrom.Text, lblTimeTo.Text))
这是正确的语法吗?当然,, Nos
,Nme
等SundayX
是我的变量。