Results 1 to 3 of 3

Thread: Unable to do UPDATE

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    19

    Unhappy Unable to do UPDATE

    M new here.I try to do change my password but unable to change it... The error is the one i put in italic,mentioning Object Variable required... may i know what goes wrong with my code..Please help .Thank you.



    VB Code:
    1. ....[ If Not CheckPass_Rs.BOF Then
    2.             CheckPass_Rs.MoveFirst
    3.             str_Password = CheckPass_Rs!Password
    4.             If Trim$(UCase$(Old_Tbox.Text)) <> str_Password Then
    5.                 MsgBox "Invalid old password"
    6.                 Old_Tbox.Text = ""
    7.                 NewPass_Tbox.Text = ""
    8.                 Verify_Tbox.Text = ""
    9.                 Old_Tbox.SetFocus
    10.             Else
    11.                 [I]oSQL[/I].Execute "UPDATE UserMaster SET Password = '" & UCase$(NewPass_Tbox.Text) & "' where User_Id = '" & UCase$(UID_Tbox.Text) & "'"
    12. Call MsgBox("You have successfully chosen a new password", vbInformation, "Password Changed")
    13.             End If
    14.         End If

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Unable to do UPDATE

    Welcome to the forums!

    How did you declare oSQL? It should be a connection or command object...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: Unable to do UPDATE

    frimily:

    Password is a reserved word/keyword and therefore, when you use any keyword to name database objects, you must delimit them within the sql statement.

    Delimit the word Password with square brackets.

    sSQL = sSQL & "[Password], "

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width