iOS Question B4i - Sql error: Warning: I could not find the column named 'Col1'.

WebQuest

Active Member
Licensed User
Hi guys it seems a bit strange to me that there are not many 'questions' for the IOS / B4i section. Anyway I'm translating my app from Android to IOS with B4i. I have read the documentation regarding the differences between B4a and B4i regarding SQL. But despite everything I get more errors from the compiler. In B4a I had similar problems but by uninstalling the app in production and changing the package name I could test without errors. Such thing does not work with B4i and Iphone.

The error is this: Warning:
--------------------------------------------------------
I could not find the column named 'Col1'.
Error calling sqlite3_step (21: out of memory) rs
--------------------------------------------------------
I verified that the DB contained the table 'Col1' = ok
I have directed the file to 'File.DirLibrary' (the file exists) = Ok
I initialized the SQL var correctly = ok
I have been attentive to the syntax because B4i iSql Library is case sensitive.

Now I have no idea why I am getting this error has anyone had the same problem?

NOTE: I get this error only after I have entered a data with an INSERT query.
The code I am using:
B4i Code:
Dim ResultSet As ResultSet= s.ExecQuery("SELECT Col1 FROM Person")
dim VarPer as string 
  
    Do While ResultSet.NextRow
        ResultSet.NextRow
        VarPer=ResultSet.GetString("Col1")
        'Log("Person:"&VarPer)
    Loop
  
ResultSet.Close
 

WebQuest

Active Member
Licensed User
It is not my intention to skip the record! But B4i approaching the methods of B4j I was recommended ResultSet.NextRow. I am inexperienced on B4i and don't know how to declare the cursor.
 
Upvote 0

WebQuest

Active Member
Licensed User
Guys I solved!
For those who encounter the same problem, I will explain what to do.
1 - Uninstall the test app from the iphone (the files and db will be removed automatically)
2 - Remove the DB from the 'Files' folder and place it in another folder for the moment.
3- Open the db with SqlLite and make a change - remove the change if not needed, Click on 'Save Changes'.
4 - Re-add the DB in the Files Tab. Making sure that the DB has made the last modification by checking 'Last Modified'.
5 - Rename the package of the project 'Ex. Example1 + '.
6 - Re-launch the app.

It is probably a problem of overwriting the DB after doing a lot of Debugging.

This Method used it with B4a to resolve unexplained errors on DBs. And it worked for B4i too.

Thank you all.
 
Upvote 0
Top