Hello All,
I will do my best to explain this problem. I am attemping to query 3 dbf files for student information. The School uses a program called SASI. Some of you may be familiar with this. I would like to use vbscript to query the files directly. The information I need is located in 3 different files. Here is how the files are laid out. One File contains the General Student Information (ASTU.DBF). Another file contains the student schedules (ACLS.DBF). The last file ties the class to the teacher (AMST.DBF).
The first file (ASTU.DBF) conatins a STULINK field which ties the student information with the Schedules (ACLS.DBF). The second file (ACLS.DBF) contains a CLASSLINK field which ties this file to the Teacher File(AMST.DBF).
This is the info that I need. Student Name, Address, Phone, located in the first file, and 1st Period Teacher' Name located in the 3rd File. Here is a snippett of my code, minus all the variable declerations.
DO WHILE NOT (StuRS.EOF) ' ASTU.DBF
strTest = 01
DO WHILE NOT (ClsRS.EOF) ' ACLS.DBF
IF StuRS.Fields(StuLink) = ClsRS.Fields(StuLink) Then
DO WHILE NOT (SchRS.EOF) ' AMST.DBF
IF ClsRS.Fields(ClassLink) = SchRS.Fields(ClassLink) Then
IF SchRS.Fields(Period) = 01 Then
wscript.echo StuFirstName & StuLastName & TchName
strTest = 02
Exit Do
Else
End If
Else
End If
SchRS.MoveNext
Loop
Else
End If
IF strTest = 02 Then
Exit Do
Else
End If
ClsRS.MoveNext
Loop
ClsRS.MoveFirst
SchRS.MoveFirst
StuRS.MoveNext
Loop
wscript.quit
I hope by this code you can see what I am trying to accomplish. I am not to concerned with the syntax of the code, but more with the logic and flow. I can actually get some of the information i need back, but I am only getting half of the records.
Thanks in Advance
Start Free Trial