Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 10th, 2005, 12:23 PM
calumog calumog is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 calumog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
2 updates from sql - need help

Hi,

I'm sure there's an easy answer to this one but I'm pretty green when it comes to asp and would appreciate help:

I want to update 2 fields in an Access database, both in the same table (oitems). I have 2 sql statements and I want to run them both from

if strCheck = "1" then (that just says if a checkbox is checked do the following):

strSQL = "UPDATE oitems SET checkbox = '" & strCheck & "'" & "WHERE orderitemid = " & strID
strSQL = "UPDATE oitems SET picked1 = numitems WHERE orderitemid = " & strID

The first marks a checkbox as 'checked' then that value is read back from the db on redirect. Fine, it works
The second makes the field 'picked1' have the same value as the field 'numitems'. That works too

But I don't know how to get it to do both at the same time

Any help greatly appreciated

Malc

Reply With Quote
  #2  
Old January 10th, 2005, 12:36 PM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 22 h 21 m 10 sec
Reputation Power: 1488
Use:
strSQL = "UPDATE oitems SET checkbox = '" & strCheck & "' , [picked1] = [numitems] WHERE orderitemid = " & strID

Reply With Quote
  #3  
Old January 11th, 2005, 03:56 AM
calumog calumog is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 calumog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

that works perfectly. Thanks a million!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > 2 updates from sql - need help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT