I’m working on my first iOS app so please bear with me. I’m using Eddies Electronics from the sample projects as a guide.
The sample project uses the following syntax to update a record in the database:
Dim sSQL As Text
sSQL = "UPDATE Customers SET FirstName = ?1, LastName = ?2, " + _
"Address = ?3, City = ?4, State = ?5, Zip = ?6, Phone = ?7, " + _
"Email = ?8, WHERE pkRecID = ?9"
// Pass in values after sql instead of doing string replacement
App.dbSQL.SQLExecute(sSQL, FirstName, LastName, Address, City, State, _
Zip, Phone, Email, pkRecID)
In my desktop apps I use (and prefer over the above) the following:
sSQL = "SELECT * FROM Customers WHERE pkRecID = " + str(iCurrentRecord)
rsRecall = dbSQL.SQLSelect(sSQL)
if dbSQL.Error then
MsgBox(dbSQL.ErrorMessage)
Quit
end if
if tfGoesByName.Text = "" then
tfGoesByName.Text = tfFirstName.Text
end if
rsRecall.Edit
rsRecall.Field("Status").StringValue = pmStatus.Text
rsRecall.Field("FirstName").StringValue = tfFirstName.Text
rsRecall.Field("LastName").StringValue = tfLastName.Text
.
.
.
rsRecall.Field("Image").PictureValue = cImage.Backdrop
rsRecall.Field("Comments").StringValue = taComments.Text
rsRecall.Update
Is the latter version of code available in iOS or am I forced to use the UPDATE format?
I also like to use the NEW database record followed by the InsertRecord statement…
thanks in advance…