Вопрос

Can someone please check my sql statement. I've checked that each variable a to e does have a value. And I am calling all the correct columns. I'm just not sure if my statement is correct.

But I am getting a error: No value given for one or more required parameters.

This is being run in a HTA vbscript.

sub updateUser(a,b,c,d,e)

SQL_query = "UPDATE users_tbl SET fname = '"& b &"', user_type = '"& c &"', email = '"& d &"', department = '"& e &"'  WHERE uid= '"& a
conn.Execute(SQL_query)

end sub
Это было полезно?

Решение

If your uid is character type, use this:

SQL_query = "UPDATE users_tbl SET fname = '"& b &"', user_type = '"& c &"', email = '"& d &"', department = '"& e &"'  WHERE uid= '"& a &"'"

if it numeric type, use this:

SQL_query = "UPDATE users_tbl SET fname = '"& b &"', user_type = '"& c &"', email = '"& d &"', department = '"& e &"'  WHERE uid= " & a

Note, that your manner of using parameters is security prone.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top