Error Trying to create a db connection 
Author Message
 Error Trying to create a db connection

This is the login verification system that I am trying to debug.  I get a
Compile Error: Wrong number of Arguments or Invalid Property assignment.
Message when I try to run this segment of code

If I remove the set command from lines 3 and 4 I get a Object Variable or
with block variable not set, i seem to get this error if I try it other ways
as well.

If you have any Ideas, Please let me know...  or if you know of a better way
to connnect to the sql server without using the adodc object on a form( in
script) let me know as well.

Thanks In advance.


Private Sub cmdOK_Click()
Dim TC As Adodc
Set TC.ConnectionString = "Provider=SQLOLEDB.1;Password=password;Persist
Security Info=True;User ID=sa;Initial Catalog=LoanTracker;Data
Set TC.RecordSource = "ActiveUsers"
LoginAttempt = LoginAttempt + 1


Do While Not DB.Recordset.EOF
    If txtUserName.Text = Trim(DB.Recordset!UserName) Then
        If txtPassword - Trim(DB.Recordset!Password) Then
            If LoginAttempt >= 3 Then
                ' User Has Exceeded The Local Login - Event Code 4
                EventLog "", 0, 3, txtUserName.Text, txtPassword.Text, "",
"", ""
                MsgBox "The system has detected a possible hack attempt and
is closing this program", vbCritical, "Error"
            ElseIf DB.Recordset!LockOut = True Then
                ' User's Account is Locked - Event Code 6
                EventLog txtUserName.Text, 0, 6, "", "", "", "", ""
            ElseIf DB.Recordset!FaildLoginCount >= 3 Then
                ' User has had too many bad login attempts in a row - Event
Code 5
                DB.Recordset!LockedOut = 1
                EventLog txtUserName.Text, 0, 5, "", "", "", "", ""
                MsgBox "Your account has been locked out.  Please contact an
Administrator", vbCritical, "Security Violation!"
            ElseIf DB.Recordset!SystemActive = True Then
                'User is active in the system. - Event Code 22

                    Do While Not TC.Recordset.EOF
                        If TC.Recordset!UserID = DB.Recordset!UserID Then
                            ' User Has a Login Record
                                If TC.Recordset!MAC <> GetMACAddress() Then
                                    ' User is trying to establish too may
                                    EventLog txtUserName.Text, 0, 22, "",
"", "", "", ""
                                    MsgBox "Your account is currently active
in the system. You are only allowed one conncurrent connection.  If you are
not logged in on another machine, this may mean that your account has been
compromised, in which case contact the Admin immidiately.", vbCritical,
"Concurrent Connections Error!"
                                End If
                        End If
            ElseIf txtPassword.Text = DB.Recordset!Password Then
               'Login Successful - Event 1
               EventLog txtUserName.Text, 0, 1, "", "", "", "", ""
               UserID = DB.Recordset!UserGuid
               UserName = DB.Recordset!UserName
               Alais = DB.Recordset!Alais
               DB.Recordset!LastSystemAccess = NumerateDateTime()
                MsgBox "An Unknown Event Occured while processing the
            End If
        End If
    End If

End Sub

Tue, 04 Oct 2005 08:23:11 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Getting an Error 429 when trying to create an ADO connection

2. Losing connection to Db and trying to recover

3. VB tries to Open MS Access DB [ERROR]

4. Jet error trying to open a db on another machine in a W98 network

5. Jet error trying to open a db on another machine in a W98 network

6. Error 536 (Incorrect logon parameters) when trying to logon to a access-db via PELogonServer

7. VB tries to Open MS Access DB [ERROR]

8. Error when trying to save a BMP file from image control in an Access 97 db

9. Invalid Use of NEW Keyword creating DB Connection

10. How to create DB connection for shape.

11. How to create DB connection for shape.

12. Run time error when trying to save a created file


Powered by phpBB® Forum Software