Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Private Sub Logout_Press()

If username.Value <> "No User" Then


Dim cn
Dim rs
Dim auditqry

Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.ConnectionString = "Provider=SQLOLEDB.1;Password=radix@123;Initial
Catalog=Radix_Instant;Persist Security Info=True;User ID=sa;Data Source= '" &
SQLSVRNAME.Value & "'"
cn.Open

auditqry = "INSERT INTO [Radix_Instant].[dbo].[Audit]([Date_time],[Description],


[UserName]) VALUES(GETDATE(),'User Logout.','" & txtuser.Value & "')"
cn.execute (auditqry)

cn.close
Set rs = Nothing
Set cn = Nothing

End If
userlevel.Value = 100
username.Value = "No User"

End Sub

You might also like