Home All Groups Group Topic Archive Search About

Access and SQL server update

Author
1 Dec 2006 4:24 AM
Bonzol
Hey there,, I know when updating,, Access can be differnt from SQL
server

this works in access from a vb.net 1.1 prog


SQL = "Update Clients SET UnameID= '" + updatevalue + "' WHERE ID = " +

checkValue + ""


Can anyone just quickly tell me what i have to change for it to work in

SQL server 2005?


Thanx..

Author
1 Dec 2006 4:31 AM
Stephany Young
Nothing, but you don't need the + "" at the end for either.


Show quoteHide quote
"Bonzol" <Bon***@hotmail.com> wrote in message
news:1164947082.853450.293220@79g2000cws.googlegroups.com...
> Hey there,, I know when updating,, Access can be differnt from SQL
> server
>
> this works in access from a vb.net 1.1 prog
>
>
> SQL = "Update Clients SET UnameID= '" + updatevalue + "' WHERE ID = " +
>
> checkValue + ""
>
>
> Can anyone just quickly tell me what i have to change for it to work in
>
> SQL server 2005?
>
>
> Thanx..
>
Author
1 Dec 2006 4:43 AM
Cor Ligthert [MVP]
Bonzol,

As this is VB it would be nicer to use the concationation character &
instead of the + character, with option strict of  the latter can give very
strange results.

Cor

Show quoteHide quote
"Bonzol" <Bon***@hotmail.com> schreef in bericht
news:1164947082.853450.293220@79g2000cws.googlegroups.com...
> Hey there,, I know when updating,, Access can be differnt from SQL
> server
>
> this works in access from a vb.net 1.1 prog
>
>
> SQL = "Update Clients SET UnameID= '" + updatevalue + "' WHERE ID = " +
>
> checkValue + ""
>
>
> Can anyone just quickly tell me what i have to change for it to work in
>
> SQL server 2005?
>
>
> Thanx..
>
Author
1 Dec 2006 7:55 PM
Rad [Visual C# MVP]
It will work as is, but you are exposing yourself to SQL injection
attacks as well as errors when someone passes a value like o'malley.

Try and use parameterized SQL as much as possible

Show quoteHide quote
On 30 Nov 2006 20:24:42 -0800, "Bonzol" <Bon***@hotmail.com> wrote:

>Hey there,, I know when updating,, Access can be differnt from SQL
>server
>
>this works in access from a vb.net 1.1 prog
>
>
>SQL = "Update Clients SET UnameID= '" + updatevalue + "' WHERE ID = " +
>
>checkValue + ""
>
>
>Can anyone just quickly tell me what i have to change for it to work in
>
>SQL server 2005?
>
>
>Thanx..
--

Bits.Bytes.
http://bytes.thinkersroom.com