🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SQL update statement in VB

#75
From: Al Reid
Date: Wed, 04 May 2005 16:51
26 lines
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
Technical Details
Message-ID: <#OCcomMUFHA.3448@TK2MSFTNGP10.phx.gbl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!koehntopp.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!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
Reply-To: "Al Reid" <areidjr@reidDASHhome.com>
From: "Al Reid" <areidjr@reidDASHhome.com>
References: <1X6ee.7511$db7.5870@trnddc01>
Subject: Re: SQL update statement in VB
Date: Wed, 4 May 2005 12:51:41 -0400
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <#OCcomMUFHA.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: 208.40.168.130
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!koehntopp.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl