469,330 Members | 1,286 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

Can't pass Recordset in recursive function

Hi

Am facing a problem while passing Recordset object in a recursive function or to 3rd level of function. Please help.

My javascript code is:

Expand|Select|Wrap|Line Numbers
  1. function fn1()
  2. {
  3.  
  4.     var connPatient = new   ActiveXObject("ADODB.Connection")
  5.     connPatient.open( "", "", "" );
  6.     var rsPatientList = new ActiveXObject("ADODB.Recordset");
  7.     var strQuery = "";
  8.      rsPatientList.open ( strQuery , connPatient, 3 );
  9.      fn2( rsPatientList);
  10.  
  11. }
  12.  
  13. function fn2( rsObj )
  14. {
  15.  
  16. alert( rsObj.recordCount); // Returning correct result
  17. fn3( rsObj );
  18.  
  19. }
  20.  
  21. function fn3( rsObj1 )
  22. {
  23.  
  24. alert( rsObj1.recordCount); // Returning error
  25. fn3( rsObj );
  26.  
  27. }


Thank you.
Apr 7 '07 #1
1 1800
acoder
16,027 Expert Mod 8TB
For recursion, you need an end case - fn3 will be called repeatedly in an endless loop. Also, rsObj doesn't exist within fn3.
Feb 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Davy | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.