473,387 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1986
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

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

Similar topics

3
by: Lyn | last post by:
Hi, I have been experiencing a problem passing a LIKE statement in the WHERE argument of a DoCmd.Openform statement. I have posted that issue separately. However, in an attempt to work around...
15
by: Dave | last post by:
Has anyone encountered the error message "Can not open any more databases" and what did you do to solve it? Thanks, Dave
0
by: sasan3 | last post by:
Let's say I have the following table: A B C D ----------- 1 1 1 6 1 1 2 7 2 2 3 8 2 2 4 9
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
3
by: laparico2002 | last post by:
I am quite new to VB6.0. Now am trying to create a connection to NWIND.mdb. But each time i run my program i keep getting error in "Wrong argument passed" the below were what i wrote in my MODULE ...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
3
by: Davy | last post by:
Hi all, Sometimes I need to pass same parameter in recursive function. From my point of view, the style is redundant, and I don't what to use some global style like self.A, self.B, Is there any...
13
by: ChrisD76 | last post by:
Hi, I am new to using VBA, and have been working with DAO Recordsets. I'm working on a little problem, and think that DAO Recordsets are the solution. I've been playing around with them to try and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.