[quoted text, click to view] "Justin" <yyf_pl@hotmail.com> wrote in message
news:075901c349f2$0f14f1d0$a101280a@phx.gbl...
> The code below can't seems to work. Can you please tell me
> how i can refer a query to a value gave by the users to
> find the specific row of data to be modified
>
>
> Dim intID As integer = tbID.Text
> Dim strPassword as string = tbPass.text
>
> MyComponent2.OleDbUpdateCommand1.CommandText
> = " UPDATE UserDetails " & _
> " SET Password = strPassword WHERE ID = intID"
>
> MyComponent2.OleDbConnection1.Open()
> MyComponent2.OleDbUpdateCommand1.ExecuteNonQuery()
> MyComponent2.OleDbConnection1.Close()
Although you don't provide the error message received when this code
executes, I'll have a go at the possible problem. Password is a string field
and you need to put the variable name in single quotes to indicate the
content type in your SQL query - SET Password = 'strPassword'. In the case
of the value for ID (intID), such punctuation is not needed because the
value is numeric.
Again, this is a guess based on info provided.