Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:48:43+00:00 2026-06-01T22:48:43+00:00

I have a program where a user can update their Password by Entering their

  • 0

I have a program where a user can update their Password by Entering their old password in a textbox, and entering their new password in a separate textbox.

An update query then updates the database with the new password.

Try
            If tbOldPassword.Text <> "" Then
                For Each Row In ds.Tables("sqlAddNewDetails").Rows
                    If Row.Item(0) = gblstrUserID Then
                        If Row.Item(1) = tbOldPassword.Text Then
                            If tbPassword.Text = tbRePassword.Text Then

                                'Updates the database
                                sqlUpdate = ("UPDATE Users SET Password = '" & tbPassword.Text & "' WHERE userID = " & Row.Item(0))
                                Dim cmd As New OleDbCommand(sqlUpdate, con)
                                cmd.ExecuteNonQuery()
                                MsgBox("Password successfully changed")
                            Else : MsgBox("The passwords are not the same")
                            End If
                        Else : MsgBox("Invalid old password")
                        End If
                    End If
                Next
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

However, everytime the code gets to cmd.ExecuteNonQuery(), it throws up an error saying that there is a syntax error in the Update query. However, If I use this query in Microsoft Access, it works fine so the Update query itself is written correctly. What could be wrong?

Note: I am using an UPDATE query in another piece of code within the same Sub routine and it works there. Its something about this query.

Note Again: If I change the Update query to UPDATE Users SET EMAIL = ‘” & tbPassword.Text & “‘ WHERE userID = ” & Row.Item(0)” it works. Something about Password that throws that error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:48:44+00:00Added an answer on June 1, 2026 at 10:48 pm

    Password is a keyword, so wrap it in square brackets as below,

    UPDATE Users SET [Password] =.....

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which has a text box that the user can edit.
I have a Win32 C++ program that validates user input and updates the UI
I have a program that needs to run as a separate NT user to
I have a program that allows the user to enter a level number, and
I have a program in which a user selects a row in a Datagrid
I have a program written in C using ncurses. It let user input and
I have a console program and I want if the user press ctrl-z the
I have to write a program in python where the user is given a
I have a project to create a program, which prevents the user from escaping
I develop a Python-based drawing program, Whyteboard . I have tools that the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.