|
-
Apr 9th, 2004, 11:05 PM
#1
Thread Starter
Hyperactive Member
Multi Loop sql statement
Hi,
I have 3 tbls
Student : StdID,Name
Score : Name, Subject, Score
Summry : StdID,Name, Score, Subject
suspose each fields and each tbl has so many records.
I want to insert into tblSummary which depends on...
- I need to loop until score is end of that fileds then insert StdID
to summary
- I mean StdID in Summary must also have every subject
of tblScore.
This is my coding (unsucceeded)
Do While Not rsScore.EOF
Do While Not rsStd.EOF
wp = rsStd.Fields!StdID
comtxt = "Insert Into tblSummry (StdID,Name)" & _
"Values('" & wp & "','" & rsScore.Fields!name & "')"
upCom.ActiveConnection = cn
upCom.CommandType = adCmdText
upCom.CommandText = comtxt
upCom.Execute
rsStd.MoveNext
Loop
rsScore.MoveNext
Loop
can anyone help me?
thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|