AccessDB - Query not working

Hello,

I’m using execute non query activity passing the query as

“UPDATE ExampleTable SET comment=@comment WHERE UniqueNumber=@UniqueNumber”

The above query works, but If I replace the WHERE clause with a different value, that is,

“UPDATE ExampleTable SET comment=@comment WHERE ID=@ID”

It’s not working.

I tried with a hardcoded value as -

"UPDATE ExampleTable SET comment=@comment WHERE ID=“123”

and it’s correctly working. It doesn’t work If I pass the value as parameter.

I have verified the parameter name and value multiple times, it’s correct. Is there something which I’m missing?

What is the error message you are getting?

There’s no error message. The DB is not updating.

Hi @manojj.yadav

You can use the variables also to update the database like below

"Update [TableName] set [Comment]='Processed Successfully',[Comment2]=('"+CommentVarible+"') Where [ID]=('"+IDNumber+"')"

In this example i have created variables CommentVarible & IDNumber & passed them in the update query.

Hope this helps :slight_smile:

1 Like

@manojj.yadav

What is the datatype of the ID column…accordingly you need to either use single quote around or no…even if you use a variabel you still might need to use quotes if it is string

Cheers