CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Please i really this the answer to this question!

Print topic Send  topic

Author Message
charles
Posted: 02/19/2004, 2:57 PM

I am having problems with this custom insert code for updating product
inventory after a transaction has taken place on the the order_items table.
There is no error message but no updates takes place either.
here is my code for the after execute update event
Dim SQL
Dim Connection
Dim ErrorMessage

SQL = "update products "&_
"set unitsinstock=(products.unitsinstock-order_items.quantity)"&_
"from products,order_items"&_
"where products.product_id = order_items.product_id"
Set Connection = New clsDBConnection1
Connection.Open
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0


DonB
Posted: 02/19/2004, 3:08 PM

You at least need to do a couple things, I think: (1) put spaces after the
quote mark a the beginning of each line (like " FROM); (2) put spaces before
and after the "&" contatenation character. Maybe they are there in the code
and just not evident in your message?

I assume that if you execute the from/where portion with a SELECT that it
will return some rows. Have you verified that this is not updating due to
it being an "empty" set (of records)?

--
DonB

http://www.gotodon.com/ccbth


"charles" <ronicsyscom@ronicsystems.com> wrote in message
news:c13f14$n1u$1@news.codecharge.com...
> I am having problems with this custom insert code for updating product
> inventory after a transaction has taken place on the the order_items
table.
> There is no error message but no updates takes place either.
> here is my code for the after execute update event
> Dim SQL
> Dim Connection
> Dim ErrorMessage
>
> SQL = "update products "&_
> "set unitsinstock=(products.unitsinstock-order_items.quantity)"&_
> "from products,order_items"&_
> "where products.product_id = order_items.product_id"
> Set Connection = New clsDBConnection1
> Connection.Open
> Connection.Execute(SQL)
> ErrorMessage = CCProcessError(Connection)
> Connection.Close
> Set Connection = Nothing
> On Error Goto 0
>
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.