🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-sqlserver
Article #76

Re: SQL update statement in VB

#76
From: Bob Butler
Date: Wed, 04 May 2005 16:54
28 lines
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..."
Technical Details
Message-ID: <#sW5ynMUFHA.3448@TK2MSFTNGP10.phx.gbl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
References: <1X6ee.7511$db7.5870@trnddc01>

Show Full Headers
Complete Article Headers
X-Google-Thread: 104de1,61d217a15791e81c
X-Google-Thread: ff490,61d217a15791e81c
X-Google-Thread: 10f695,61d217a15791e81c
X-Google-Thread: 10b213,61d217a15791e81c
X-Google-Attributes: gid104de1,gidff490,gid10f695,gid10b213,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bob Butler" <tiredofit@nospam.com>
References: <1X6ee.7511$db7.5870@trnddc01>
Subject: Re: SQL update statement in VB
Date: Wed, 4 May 2005 09:54:03 -0700
Lines: 29
MIME-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478
Message-ID: <#sW5ynMUFHA.3448@TK2MSFTNGP10.phx.gbl>
Newsgroups: comp.databases.ms-sqlserver,comp.lang.visual.basic.misc,cz.comp.microsoft.sql,microsoft.public.sqlserver.server,microsoft.public.vb.controls
NNTP-Posting-Host: unk-for-smtp.isus.emc.com 128.222.32.10
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl