0

I am getting syntax error for below code: Please help

 db.Execute "UPDATE Account_Manager_Details" _
    & "SET count = count + 1 " _
    & "WHERE ID = " & id & ";"

Thanks You.

2
  • How to debug dynamic SQL in VBA Commented May 25, 2017 at 8:27
  • Also, count is a reserved word in SQL, use [count] or better: rename the column. Commented May 25, 2017 at 8:27

1 Answer 1

1

You need a space between the table name and the "SET" statement.

db.Execute "UPDATE Account_Manager_Details "

It's a good idea to assign your SQL statement to a string before you execute it, then you can see exactly what you are doing.

sSQL = "update account_manager_details ... " _
db.execute sSQL, dbfailonerror
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.