Update Query in MS Access
-
Hi all, how to write update Query in MS Access?? in sql, we write like this "update tablename set field = '"+ +"' where field= '"+ +"'";" but its giving an error whenever i write the same query in access...... so, could any one help me how to write "update Query in ms access plz/// Thanks in Advance.! :)
-
Hi all, how to write update Query in MS Access?? in sql, we write like this "update tablename set field = '"+ +"' where field= '"+ +"'";" but its giving an error whenever i write the same query in access...... so, could any one help me how to write "update Query in ms access plz/// Thanks in Advance.! :)
Hi, your syntax is principally correct. What error are you getting? Robert
-
Hi all, how to write update Query in MS Access?? in sql, we write like this "update tablename set field = '"+ +"' where field= '"+ +"'";" but its giving an error whenever i write the same query in access...... so, could any one help me how to write "update Query in ms access plz/// Thanks in Advance.! :)
"update tablename set field = '"+ +"' where field= '"+ +"'";" If the above is exactly your code. It is a matter of c# syntax Actually you have redundant " The correction is "update tablename set field = '"+ +"' where field= '"+ +"';" Also, you can truncate the smicolon of the query "update tablename set field = '"+ +"' where field= '"+ +"'" I hope this helps :laugh::laugh:
Mohamed Gouda Egypt
-
Hi, your syntax is principally correct. What error are you getting? Robert
-
"update tablename set field = '"+ +"' where field= '"+ +"'";" If the above is exactly your code. It is a matter of c# syntax Actually you have redundant " The correction is "update tablename set field = '"+ +"' where field= '"+ +"';" Also, you can truncate the smicolon of the query "update tablename set field = '"+ +"' where field= '"+ +"'" I hope this helps :laugh::laugh:
Mohamed Gouda Egypt
Hi, thanks for the reply... i have tried these two cases: its giving error like " ; expected " actually this is my query statements:: string strQuery = "update UserInfo set Password = '"+ txtNewPwd.Text +"' where Password = '"+ txtOldPwd.Text +"'"; any other solution plz...
-
Hi, thanks for the reply... i have tried these two cases: its giving error like " ; expected " actually this is my query statements:: string strQuery = "update UserInfo set Password = '"+ txtNewPwd.Text +"' where Password = '"+ txtOldPwd.Text +"'"; any other solution plz...
Make sure you use the correct spacing However, set a break point at that statement and debug to wathc the string
Mohamed Gouda Egypt
-
Make sure you use the correct spacing However, set a break point at that statement and debug to wathc the string
Mohamed Gouda Egypt
-
Hi, thanks for the reply... i have tried these two cases: its giving error like " ; expected " actually this is my query statements:: string strQuery = "update UserInfo set Password = '"+ txtNewPwd.Text +"' where Password = '"+ txtOldPwd.Text +"'"; any other solution plz...
string strQuery = "update UserInfo set Password = '"+ txtNewPwd.Text +"' where Password = '"+ txtOldPwd.Text +"'"; In the aove string you need to take space before WHERE Note that
'where
is COMPLETELY different from' where
This missed space makes the errorMohamed Gouda Egypt
-
string strQuery = "update UserInfo set Password = '"+ txtNewPwd.Text +"' where Password = '"+ txtOldPwd.Text +"'"; In the aove string you need to take space before WHERE Note that
'where
is COMPLETELY different from' where
This missed space makes the errorMohamed Gouda Egypt
-
Hi, thanks for the reply... i have tried these two cases: its giving error like " ; expected " actually this is my query statements:: string strQuery = "update UserInfo set Password = '"+ txtNewPwd.Text +"' where Password = '"+ txtOldPwd.Text +"'"; any other solution plz...
It might be that Password is a keyword in Access try: string strQuery = "update UserInfo set \"Password\" = '"+ txtNewPwd.Text +"' where \"Password\" = '"+ txtOldPwd.Text +"'"; Robert
-
It might be that Password is a keyword in Access try: string strQuery = "update UserInfo set \"Password\" = '"+ txtNewPwd.Text +"' where \"Password\" = '"+ txtOldPwd.Text +"'"; Robert