Hello.
I'm developing an app that is intended to hide a button if the user is not an administrator. But it throws this exception:
Error occurred on line: 109 (main)
android.database.sqlite.SQLiteException: no such column: isadmin: , while compiling: SELECT isadmin FROM users WHERE login = ?
This is the code:
This is the data stored on the database:
[isadmin] [name] [login] [password] [lastlogin]
1 Default admin ****** 12/06/2014
0 Default exec ****** 12/06/2014
The Schema:
CREATE TABLE users (isadmin NUMERIC, name TEXT, login TEXT, password TEXT, lastlogin TEXT)
I'm developing an app that is intended to hide a button if the user is not an administrator. But it throws this exception:
Error occurred on line: 109 (main)
android.database.sqlite.SQLiteException: no such column: isadmin: , while compiling: SELECT isadmin FROM users WHERE login = ?
This is the code:
B4X:
Sub CheckPassword(Password As String, Login As String)
Dim Checkme As Boolean = False
oCursor = oSql.ExecQuery2("SELECT password FROM users WHERE login = ?", Array As String(Login))
If oCursor.RowCount <> 0 Then
oCursor.Position = 0
Dim Returnme As String = oCursor.GetString2(0)
If Password = Retorno Then
Checkme = True
Loggeduser = Login
oCursor = oSql.ExecQuery2("SELECT isadmin FROM users WHERE login = ?", Array As String(Login))
oCursor.Position = 0
Dim NoBool As Short = oCursor.GetInt2(0)
If NoBool = 0 Then
Isanadmin = 0
Else
Isanadmin = 1
End If
Else
Checkme = False
End If
Else
Checkme = False
End If
Return Checkme
End Sub
This is the data stored on the database:
[isadmin] [name] [login] [password] [lastlogin]
1 Default admin ****** 12/06/2014
0 Default exec ****** 12/06/2014
The Schema:
CREATE TABLE users (isadmin NUMERIC, name TEXT, login TEXT, password TEXT, lastlogin TEXT)