Public Sub login(nome As String, password As String) As String
Dim SQLite1 As SQL
If File.Exists(File.DirApp, "data.db") = False Then
Return "File non trovato"
End If
SQLite1.InitializeSQLite(File.DirApp, "data.db", False)
Dim RowCount As Int = 0
Dim cs As ResultSet
Dim query As String
query = "SELECT * FROM utente WHERE nome = '" & nome & "' AND password = '" & password & "';"
cs = SQLite1.ExecQuery(query)
Do While cs.NextRow
If cs.GetString("nome") = "" Then
If cs.GetString("password") = "" Then
RowCount = RowCount+1
Return "Ben ritornato " & cs.GetString("nome")
End If
End If
Loop
If RowCount = 0 Then
Return "Utente sconosciuto"
End If
End Sub