|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Access and SQL server updateHey 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.. 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.. > 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.. > 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
Email Socket Question
Best way to get a Junior Programmer up to speed Exposing Com Interfaces of a .Net Class Library (Trouble Regsvr32) deployment of project migrating MSDE to SQLExpress End Processing in Multithreaded App Fastest String search Combo box to start at first character after user selects Find Window Question NNTP Question Calculate inside a form and use the same form as Insert record form |
|||||||||||||||||||||||