Thread View: comp.databases.ms-sqlserver
3 messages
3 total messages
Started by Mac
Wed, 04 May 2005 16:41
SQL update statement in VB
Author: Mac
Date: Wed, 04 May 2005 16:41
Date: Wed, 04 May 2005 16:41
20 lines
1681 bytes
1681 bytes
I am trying to update price with cost times 100. I am getting an error. I would appreciate if someone please correct my code. Thx strcnn = "DRIVER=SQL SERVER; SERVER=" & SQLSVRSTR & ";" & _ "UID=sa;PWD=TEST;DATABASE=" & SQLDBStr & ";" Set cn = New ADODB.Connection cn.Open strcnn mprodcl = prod.txtpclass markup = 100 strsql = "Update mytable SET mytable.price = " & mytable.cost & "*" & markup & "" cn.Execute strsql
Re: SQL update statement in VB
Author: Al Reid
Date: Wed, 04 May 2005 16:51
Date: Wed, 04 May 2005 16:51
26 lines
1723 bytes
1723 bytes
"Mac" <mac@hotmail.com> wrote in message news:1X6ee.7511$db7.5870@trnddc01... > I am trying to update price with cost times 100. > > I am getting an error. > > I would appreciate if someone please correct my code. > > Thx > > > > > strcnn = "DRIVER=SQL SERVER; SERVER=" & SQLSVRSTR & ";" & _ > "UID=sa;PWD=TEST;DATABASE=" & SQLDBStr & ";" > Set cn = New ADODB.Connection > cn.Open strcnn > mprodcl = prod.txtpclass > markup = 100 > strsql = "Update mytable SET mytable.price = " & mytable.cost & "*" & markup > & "" > cn.Execute strsql > > strsql = "Update mytable SET mytable.price = mytable.cost * " & markup
Re: SQL update statement in VB
Author: Bob Butler
Date: Wed, 04 May 2005 16:54
Date: Wed, 04 May 2005 16:54
28 lines
1805 bytes
1805 bytes
"Mac" <mac@hotmail.com> wrote in message news:1X6ee.7511$db7.5870@trnddc01 > I am trying to update price with cost times 100. > > I am getting an error. > > I would appreciate if someone please correct my code. > > Thx > > > > > strcnn = "DRIVER=SQL SERVER; SERVER=" & SQLSVRSTR & ";" & _ > "UID=sa;PWD=TEST;DATABASE=" & SQLDBStr & ";" > Set cn = New ADODB.Connection > cn.Open strcnn > mprodcl = prod.txtpclass > markup = 100 > strsql = "Update mytable SET mytable.price = " & mytable.cost & "*" & > markup & "" > cn.Execute strsql strsql = "Update mytable SET mytable.price = mytable.cost * " & cstr(markup) -- Reply to the group so all can participate VB.Net: "Fool me once..."
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads