Could someone please explain to me why the following code does not add a column?
Been staring at it for ages .... Its probably something simple that I am not seeing.
BTW the column is not appearing in the second log message loop.
Thanks in advance Geoff
Been staring at it for ages .... Its probably something simple that I am not seeing.
BTW the column is not appearing in the second log message loop.
Thanks in advance Geoff
B4X:
Sub addBowTypeColumn
Dim query As String
Dim cursorAdd As Cursor
' See if Bowtype is a field if not add it
query = "ALTER TABLE SightMarks ADD COLUMN BowType text"
Main.SQL1.BeginTransaction
Try
Main.SQL1.ExecNonQuery(query)
Catch
Log("failed to Add Bowtype Field")
End Try
Main.SQL1.EndTransaction
query = "SELECT * FROM SightMarks" 'get all columns
cursorAdd = Main.SQL1.ExecQuery(query)
For l=0 To cursorAdd.ColumnCount-1
Log(cursorAdd.GetColumnName(l))
Next
End Sub