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.

Gary

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
Source=localhost"
Set TC.RecordSource = "ActiveUsers"
LoginAttempt = LoginAttempt + 1

DB.Recordset.MoveFirst

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"
                End
            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
                DB.Recordset.Update
                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
connections
                                    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
                        TC.Recordset.MoveNext
                    Loop
                TC.Recordset.Close
            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()
            Else
                MsgBox "An Unknown Event Occured while processing the
logon."
            End If
        End If
    End If
Loop
DB.Recordset.Update
DB.Recordset.Close

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