Ciao a tutti, sto facendo il mio primo programma in VB e ho un paio di problemi con la classe per fare il Login. Ho fatto una finestra madre che contiene una finestrella per fare il login e ho riscontrato i due seguenti problemi:
1)Il pulsante accedi non mi fa nulla (probabilmente perchè non riesco a prendere i valori delle due textbox);
2)In fase di compilazione mi dà i due seguenti errori: 'Text' non è un membro di 'String' e 'TextLength' non è un membro di 'String'
vi posto il codice:
Private Sub Entra(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim Username As String
Dim Password As String
Username = "SELECT Username FROM Utenti WHERE" & username
Password = "SELECT Password FROM Utenti WHERE" & password
If Trim(Username.Text).Length = 0 Then
MsgBox("Inserire l'username per accedere.", vbCritical, "ERRORE")
Exit Sub
End If
If Trim(Password.Text).Length = 0 Then
MsgBox("Inserire la password per accedere.", vbCritical, "ERRORE")
Exit Sub
End If
If Username.TextLength > 0 And Password.TextLength > 0 Then
accedi.Enabled = True
Else
accedi.Enabled = False
End If
End Sub
P.s.: come DB ho usato Access