Code:
" insert into user_act(id,password,uname,date)Values ('"&txtid.text&"','"&txtpassword.text"','"&txtunam e.text&"','#"&txtdate.text&"#)"
this statement in your first post, if "id" column has numeric datatype then in your VALUES clause you enclosed the value to be inserted into "id" column in single quotes, it will be treated as a char/string value. i dunno if vb or your db will do some data coersion if not then that might cause a data type mismatch that is if "id" column is numeric.
Code:
"INSERT INTO user_act(id,password,uname) VALUES '" & Val(txtid.Text) & "','" & Left(txtpassword.Text, 20) & "'," & Left(txtuname.Text, 50) & ")"
in this statement you lacked "(" after the VALUES keyword hence the syntax error
btw, you might want to post the data types of the columns in your USER_ACT table.
also, is this the only way to do an INSERT sql in vb? if you can find another way please do so. not only is this an ugly way it's also error-prone. statements like these are also vulnerable to sql injections specially since you are concatenating values taken straight from your input fields. might not be true in this particular insert statement but if you get used to these type of sql coding you might come up with vulnerable code. just a thought.