Those errors could be any number of things.

I would improve the code before tracking down the error and after the
code improvements tell us the new error.

Improvement #1
don't read Recordset fields many times for example
RS("QVALDesc")

http://learnasp.com/learn/propertyexpense.asp
explains what I mean. Assign to variables.

Improvement #2
You did not say what connection string you are using but make sure it
is the OLEDB one not a DSN or DBQ one.

http://learnasp.com/learn/dbopen.asp
will explain why.

Improvement #3
use GetRows ala
http://www.learnasp.com/learn/subgetrows.asp
many errors can be caused by too many connections to DB open simultaneously.

http://learnasp.com/learn/whygetrows.asp
and
http://www.learnasp.com/learn/accesstest.asp
explains why
explains why.

On 8/18/05, Ananda <[EMAIL PROTECTED]> wrote:
>  I am getting this error message when I attempt to run the folowing 
>  code 
>  
>  Here I fill a couple of questions for the visitor to fill in. Each 
>  question has 4 answers like excellent, good, fai, poor. 
>  
>  Later i am aggregating the results based on the subject to see how 
>  many have ticked excellent, etc. 
>  
>  Sub GetAnswerPlus(QC) 
>  Dim ANSWERS(), Acount 
>  Dim QTYP 
>  Dim X, I, J 
>  QTYP = Question(2,QC) 
>  ' Say "Question " & QC & " has type " & QTYP & "<BR>" 
>  SQL = "SELECT * FROM QVAL Summary WHERE QVALQTYPID = " & QTYP & ";" 
>  Set RS = AC.Execute(SQL) 
>  Acount = 0 
>  Do while not(RS.EOF) 
>  Acount = Acount + 1 
>  ReDim Preserve ANSWERS(2, Acount) 
>  ANSWERS(1,Acount) = RS("QVALDesc") 
>  RS.MoveNext 
>  Loop 
>  ' Say "Acount was " & Acount & "<BR>" 
>  RS.Close 
>  ' Say "Count is " & COUNT & "<br>" 
>  For X = 1 to COUNT 
>  RESP = RESPID(X) 
>  SQL = "SELECT * FROM Summary WHERE (XFRQQUESID = " & QC & ") " 
>  SQL = SQL & " AND (XFRQRESPID = " & RESP & ") " 
>  SQL = SQL & " AND QVALID > 23;" 
>  Set RS = AC.Execute(SQL) 
>  If RS.EOF Then 
>  Say "N/R" & "<BR>" 
>  Else 
>  Say "<b>" & RS("QVALDesc") & "</b><BR>" 
>  End if 
>  For I = 1 to ACount 
>  If RS("QVALDesc") = ANSWERS(1,I) Then ------> error line 
>  ANSWERS(2,I) = ANSWERS(2,I) + 1 
>  Exit For 
>  End If 
>  Next 
>  RS.Close 
>  ' Say SQL & "<br>" 
>  Next 
>  Say "<Table width=100% border=0>" 
>  For I = 1 to Acount 
>  J = CInt(ANSWERS(2,I)) 
>  Say "<TR>" 
>  Say "<td width=50% class=left>" & ANSWERS(1,I) & "</td>" 
>  If J > 0 then 
>  Say "<td width=40% class=left><b>" & Int(((J)/Count)*100) & "%
>  </b></td>" 
>  Else 
>  Say "<td width=40% class=left> </td>" 
>  End if 
>  Say "<td width=10% class=left>" & J & "</td>" 
>  Say "</tr>" 
>  Say ANSWERS(1,I) & ": " & J & " " & Int(((J)/Count)*100) & "%<BR>" 
>  Next 
>  Say "</table>" 
>  End Sub 
>  
>  can you help on this. Any ideas?? 
>  
>  Thanks for your help. 
>  
>  
>  
>  
>  
>  
>  
>  
>  ________________________________
>  YAHOO! GROUPS LINKS 
>  
>  
>  Visit your group "AspClassicAnyQuestionIsOk" on the web.
>   
>  To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  
>  ________________________________
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h7q9pnf/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1124404392/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to