Guest User

Untitled

a guest
Sep 1st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. There's something wrong with my Update SQL statement in VB
  2. Dim tr As Transactions
  3. Set tr = New Transactions
  4.  
  5. Dim ID As Integer
  6. Dim name As String, username As String, password As String, activate As String
  7.  
  8. name = cmbName.Value
  9. ID = tr.GetUserID(name)
  10.  
  11. If (AccountActivated = True) Then
  12. username = txtUsername.Value
  13. password = txtPassword.Value
  14. MsgBox name & " " & username & " " & password
  15. activate = "Yes"
  16. Else
  17. username = ""
  18. password = ""
  19. activate = "No"
  20. End If
  21.  
  22. tr.UpdateAccount name, username, password, activate 'ERROR HERE: Object required
  23.  
  24. Public Function UpdateAccount(ByVal name As String, ByVal username As String, ByVal password As String, ByVal activation As String)
  25. Call connectDB
  26. sSQL = "update User set Username = '" & username & "', Password = '" & password & "', AccountActivated = '" & activation & "' where Name = '" & name & "'"
  27. MsgBox sSQL
  28. db.Execute sSQL
  29. End Function
Add Comment
Please, Sign In to add comment