Added: April/05/2005 at 6:15pm | IP Logged
|
|
|
Hey, i want to do the following: I want to publish a number of right answers from an access database. The database has question1, question2, question3, ... as fieldname. Because there are 80 questions and the answers are always yes or no, I want to use a loop. But I don't know how i can manage this. I gues for i=1 has something to dow ith it but i don't seem to manage it the right way.
This is the code i use:
Dim rsTotaalQuestion1 Dim strTotaalQuestion1 Set rsTotaalQuestion1 = Server.CreateObject("ADODB.Recordset") strTotaalQuestion1 = "SELECT COUNT(*) AS TotalQuestion1 FROM poll WHERE question1 = 'Yes' " rsTotaalQuestion1.Open strTotaalQuestion1, AdoCon strTotaalQuestion1 = (rsTotaalQuestion1("TotaalQuestion1")) rsTotaalQuestion1.close Set rsTotaalQuestion1 = Nothing
Dim rsTotaalQuestion2 Dim strTotaalQuestion2 Set rsTotaalQuestion2 = Server.CreateObject("ADODB.Recordset") strTotaalQuestion2 = "SELECT COUNT(*) AS TotalQuestion2 FROM poll WHERE question2 = 'Yes' " rsTotaalQuestion2.Open strTotaalQuestion2, AdoCon strTotaalQuestion2 = (rsTotaalQuestion2("TotaalQuestion2")) rsTotaalQuestion2.close Set rsTotaalQuestion2 = Nothing .....
Anyone an idea???
|