I'm having problem's in validating the user and password in the AS400 machine. I garantee that's the right user and password, i'm using. It happend's that Sai2 only active if i dont put a user or a password. If both field's of the form, text0 or text1 are filled with something, sai2 actives, although, the user and password do not exist.
I substituded de nº of the DNS, with xx.xx.xx.xxx
Private Sub Text2_Exit(Cancel As Integer)
On Error GoTo Sai2
Dim stDocName As String
Dim stLinkCriteria As String
Dim val As String
Dim liga As New ADODB.Connection
liga.ConnectionTimeout = 520
liga.Open "Provider=IBMDA400;Data Source=xx.xx.xx.xxx;", UID = Me!Text0, PWD = Me!Text2
Dim Rcds As Variant
liga.Close
stDocName = "MENU"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
Sai2:
MsgBox " User or Password Incorrect!"
Me!Text0 = Null
Me!Text2 = Null
Me!Text0.SetFocus
Exit Sub
End Sub
I substituded de nº of the DNS, with xx.xx.xx.xxx
Private Sub Text2_Exit(Cancel As Integer)
On Error GoTo Sai2
Dim stDocName As String
Dim stLinkCriteria As String
Dim val As String
Dim liga As New ADODB.Connection
liga.ConnectionTimeout = 520
liga.Open "Provider=IBMDA400;Data Source=xx.xx.xx.xxx;", UID = Me!Text0, PWD = Me!Text2
Dim Rcds As Variant
liga.Close
stDocName = "MENU"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
Sai2:
MsgBox " User or Password Incorrect!"
Me!Text0 = Null
Me!Text2 = Null
Me!Text0.SetFocus
Exit Sub
End Sub