Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2007, 06:13 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access DB Problem

Hi all.

I have an Access DB containing 3 tables (STMBIOGR, STMAOS, STCSESSD).
I am using the student_id field in STMBIOGR to find all courses that student is on in STMAOS.

My problem arises here as I need to retrieve the aos_code and aos_period fields from STMAOS (there may be multiple records) and then use them to get the aos_code, aos_period, and full_desc fields from STCSESSD. I don't want to display the fields I retrieve from STMAOS but need to hold them somewhere and then iterate through them to get the name of each course.

ie.
If STMAOS contains 2 records for a student_id, I need to iterate through these and use the aos_code and aos_period fields to get the previously mentioned fields from STCSESSD.

I just can't figure out how to hold the STMAOS data and then reiterate through it to get the name for each course.

nb. The course code consists of both the aos_code and aos_period fields so I need to just get the data from STCSESSD where that record matches both of those fields.

Any help that you could offer would be greatly appreciated as I fear I`ve bitten off more than I can chew with this one!

Hermiod

 
Old August 8th, 2007, 06:24 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I find your post a little confusing however:

;;;I just can't figure out how to hold the STMAOS data and then reiterate through it to get the name for each course
You could place these records in an array. Find all the code here:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=161

Wind is your friend
Matt
 
Old August 9th, 2007, 03:47 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is confusing! The post didn't make at alot of sense to me and I wrote it.

Thanks for the reply but a colleague helped me out and showed me how to get all the data from STMAOS and the matched data from STCSESSD in one sql string.

You can do alot more with SQL than I thought you could!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Open external DB in MS Access VB problem Derek_05 Access VBA 1 January 21st, 2006 03:51 AM
Problem with inserting data into an Access DB donrafeal ASP.NET 2.0 Basics 0 January 6th, 2006 05:34 PM
Converting Access DB to Online DB eyal8r Access 5 December 6th, 2004 05:22 AM
access db to sql server db mikersantiago Classic ASP Basics 4 November 16th, 2004 03:33 AM
Problem using wildcards to search an Access DB taliesin Classic ASP Databases 4 June 23rd, 2003 11:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.