Access 2003 and SQL 2000 Server
1) ADO code does not work. I had the two code below to print
out the two value and they are both the same, yet, it executed the else condition.
MsgBox RecordSet_User_Account!Name
MsgBox Forms!Main_Login!User_Name
If RecordSet_User_Account!Name = Forms!Main_Login!User_Name
Then MsgBox "They are the same"
Else
MsgBox "They are not the same"
End If
2) Could it be that I am using a DAO text box and not an ADO text box ? How do I have an ADO control pallet appear in Access if there is such a thing ?
/////////////////////////////////////////////////
Private Sub User_Login_Using_Table()
Dim cnThisConnect As ADODB.Connection
Dim RecordSet_User_Account As New ADODB.Recordset
Set cnThisConnect = CurrentProject.Connection
RecordSet_User_Account.Open "User_Account", _
cnThisConnect, adOpenKeyset, _
adLockOptimistic, adCmdTable
RecordSet_User_Account.MoveFirst
MsgBox RecordSet_User_Account!Name
MsgBox Me!User_Name
MsgBox RecordSet_User_Account!P
If RecordSet_User_Account!Name = _
Forms!Main_Login!User_Name Then
MsgBox "They are the same"
Else
MsgBox "They are not the same"
End If
RecordSet_User_Account.Close
End Sub
1) ADO code does not work. I had the two code below to print
out the two value and they are both the same, yet, it executed the else condition.
MsgBox RecordSet_User_Account!Name
MsgBox Forms!Main_Login!User_Name
If RecordSet_User_Account!Name = Forms!Main_Login!User_Name
Then MsgBox "They are the same"
Else
MsgBox "They are not the same"
End If
2) Could it be that I am using a DAO text box and not an ADO text box ? How do I have an ADO control pallet appear in Access if there is such a thing ?
/////////////////////////////////////////////////
Private Sub User_Login_Using_Table()
Dim cnThisConnect As ADODB.Connection
Dim RecordSet_User_Account As New ADODB.Recordset
Set cnThisConnect = CurrentProject.Connection
RecordSet_User_Account.Open "User_Account", _
cnThisConnect, adOpenKeyset, _
adLockOptimistic, adCmdTable
RecordSet_User_Account.MoveFirst
MsgBox RecordSet_User_Account!Name
MsgBox Me!User_Name
MsgBox RecordSet_User_Account!P
If RecordSet_User_Account!Name = _
Forms!Main_Login!User_Name Then
MsgBox "They are the same"
Else
MsgBox "They are not the same"
End If
RecordSet_User_Account.Close
End Sub