I am using the following code snippet courtesy of @Mashiane
This works great and I get all the field names
In the above code I must look for a field "feedback" (which does not exist in the current list)
If it does not exist, I must append the new field "feedback" to the table.
How do I check the Field Name from the above Log?
How do I append / add the new field to the table?
I have looked at loads of examples, but for some reason, cannot get it to work.
B4X:
Dim strFld As String
Dim fType As String
Dim curFields As List
Dim cur As ResultSet
curFields.Initialize
cur = DB.ExecQuery("PRAGMA table_info ('" & tblName & "')")
Do While cur.NextRow
strFld = cur.GetString("name")
LogColor("Field Name: " & strFld, Colors.Red)
fType = cur.GetString("type")
If fType.ToLowerCase = "text" Then curFields.Add(strFld)
Loop
cur.close
Return curFields
B4X:
Field Name: id
Field Name: lastname
Field Name: firstname
Field Name: address1
Field Name: address2
Field Name: suburb
Field Name: city
Field Name: occupation
Field Name: income
Field Name: cellno
Field Name: email
Field Name: product
In the above code I must look for a field "feedback" (which does not exist in the current list)
If it does not exist, I must append the new field "feedback" to the table.
How do I check the Field Name from the above Log?
How do I append / add the new field to the table?
I have looked at loads of examples, but for some reason, cannot get it to work.