Option Explicit Private Sub cmdCancel_Click()
Unload Me End Sub Private Sub cmdOK_Click()
If Me.txtUserName <> "" And Me.txtPassword <> ""
And Me.cboUserRole.Text <> "" Then
Call connectdb
query = "SELECT * FROM Users WHERE username = '" & Me.txtUserName & "'
AND password = '" & Me.txtPassword & "' AND accessLevel =
'" & Me.cboUserRole.ListIndex + 1 & "'"
Set rs = db.Execute(query)
If rs.RecordCount > 0 Then
username1 = Me.txtUserName.Text
If Me.cboUserRole.ListIndex = 0 Then
accessLevel1 = "Administrator" Else
accessLevel1 = "Client" End If
query = "INSERT INTO UserLog
(username, accessLevel, loginTime, logoutTime)
VALUES('" & username1 & "', '" & accessLevel1 & "',
'" & Date & " " & Time & "', ' " & Date & " " & Time & "')"
db.Execute (query) db.Close
frmMain.Show Unload Me Else
MsgBox "User does not exist",
vbCritical, "RBEI Raw Materials Inventory System"
End If Else MsgBox "Please complete the form",
vbCritical, "RBEI Raw Materials Inventory System" End If End Sub
How to convert mssql 2000 query statements here like
"SELECT * FROM Users WHERE username = '" & Me.txtUserName & "' AND password = '" & Me.txtPassword & "' AND accessLevel = '" & Me.cboUserRole.ListIndex + 1 & "'"
I don't have knowledge in ms access that's why i find it so difficult to convert all of the mssql 2000 query statements here into ms access 2003. I already created and connected this to ms access 2003 so there's no more problem regarding with connection string, etc; but still this requires a little tweaking in order to run perfectly. I need to convert this to ms access 2003 because my prof. didn't allow me to use mssql server.
Thanks in advance.
All help greatly appreciated.

New Topic/Question
Reply



MultiQuote




|