#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Query timeout expired when doing update to password to a field


    Hi all,

    I am having a problem with this execute code

    Code:
    dbConnection.Execute "update [Staff Details] set " & AddFieldWrappers(cPasswordField) & "='" & md5(password) & "' where " & sWhere
    Apparently, it keeps on generating query timeout when updating the password field and only in SQL database. In access database the code works fine. The database is accessible since other scripts and queries work well apart from this one on the remind password page.

    Can anyone with an idea to the solution help? Will really appreciate.

    Regards,

    Erick
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,424
    Rep Power
    4539
    Capture the sql string your code is generating and try running it manually in your sql server query tool.
    ======
    Doug G
    ======
    The man who doesn't read good books has no advantage over the man who can't read them.
    --Mark Twain
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0
    Originally Posted by Doug G
    Capture the sql string your code is generating and try running it manually in your sql server query tool.
    Dear Doug,

    I have queried this
    Code:
    update [Staff Details] set [password]='' where [username]='admin'
    which is generated when I did response write in the sql server but yes it is indicating that it is executed but when you use the password which was sent after the generated one it still seems the field was not updated.

    Other queries like "select * from [Staff Details]" query works pretty well returning all the values in the table. I have also checked the table and it shows that the encrypted password was indeed updated.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,424
    Rep Power
    4539
    I don't know. As a guess, check your database structure and verify the password field accepts a string datatype.

    You might edit out the hash value from your post.

    Also make sure the [name] bracket syntax is correct and doesn't need quotes or something. I mostly use mysql these days which needs backticks around column names, not brackets, and if I recall correctly there is a setting in sql server relating to quoted identifiers.
    ======
    Doug G
    ======
    The man who doesn't read good books has no advantage over the man who can't read them.
    --Mark Twain
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0
    Originally Posted by Doug G
    I don't know. As a guess, check your database structure and verify the password field accepts a string datatype.

    You might edit out the hash value from your post.

    Also make sure the [name] bracket syntax is correct and doesn't need quotes or something. I mostly use mysql these days which needs backticks around column names, not brackets, and if I recall correctly there is a setting in sql server relating to quoted identifiers.
    Hi,

    Okay thanks will look into that. Regards

IMN logo majestic logo threadwatch logo seochat tools logo