ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

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 Dev Shed Forums Sponsor:
  #1  
Old January 27th, 2004, 08:35 PM
Porky Porky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: England
Posts: 278 Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 11 h 22 m 13 sec
Reputation Power: 16
How do I denote rows in a recordset?!

Hi guys,

I hope I can make this problem clear enough - Im afraid I dont really have any specific code (yet) but im looking more for "concepts"...

I have a database (in Access) that contains a table, and this table contains lots of records. Each record can be either Case1, Case2 or Case3. Every hour, I wish for the table to be "refreshed" - i.e. a script will alter all data in the database depending on whether the record is Case1, Case2 or Case3. I have no difficulty in doing the code for each Case, but my problem lies in what method to use. I can think of two ways of doing this:

1 - To just select every record in the table (i.e. all Cases), take the first record in the recordset (of the entire table), look at its case, then depending on result run either ScriptCase1, ScriptCase2, ScriptCase3, run the script, move to the next one, look at whether its case 1, 2, or 3....run the appropriate script, move to the next and so on...........or

2 - To select all the entries in the table and put them into a recordset that are one Case - eg select everything that is case A. Run the script for Case A on the whole record set, then select all record entries that are Case B, run a script that updates this set, and so on......

To begin with, I cant decide which technique would be better, and also, for the second case I am not sure how to update a row within a record.

If i Have a table with rows such as:

AutoNumber Type Otherdata
1 Case1 blah blah
2 Case2 etc etc
3 Case1 yada yada

If i use the second method to put rows 1 and 3 into a record set, in my update script there will be a line that says something like:

...............("UPDATE otherdata SET something=something WHERE ****************">

The ********** section is the bit i cannot solve......i cant create a variable called "Autonumber" ( WHERE Autonumber="1" for example) and add 1 to it each time I move to the next record because in this particular case there is no "Autonumber="2") because it is Case2.

I hope this makes some sense - ive managed to confuse myself talking about it... If im a lost cause then just ignore me

If anyone could point me in the right direction or spot a suitable way to do this I would be extreeeemely grateful,

Thanks once again guys,

Porky

Reply With Quote
  #2  
Old January 27th, 2004, 08:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 13th Plane (11000 - 11499 posts)
 
Join Date: Jun 2003
Posts: 11,234 Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 7 h 12 m 7 sec
Reputation Power: 909
Use your option 2 imho.

Reply With Quote
  #3  
Old January 28th, 2004, 07:30 AM
Porky Porky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: England
Posts: 278 Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level)Porky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 11 h 22 m 13 sec
Reputation Power: 16
I thought that would be better also - but as i say, i cant figure out how to finish the line with the "UPDATE" command on it. If i dont include the "WHERE" part of the line, the script will not do what i want it to, but i dont know how to tell the different records apart in the recordset

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > How do I denote rows in a recordset?!


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





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