473,372 Members | 1,244 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,372 software developers and data experts.

Can't pass Recordset in recursive function


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. {
  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);
  11. }
  13. function fn2( rsObj )
  14. {
  16. alert( rsObj.recordCount); // Returning correct result
  17. fn3( rsObj );
  19. }
  21. function fn3( rsObj1 )
  22. {
  24. alert( rsObj1.recordCount); // Returning error
  25. fn3( rsObj );
  27. }

Thank you.
Apr 7 '07 #1
1 1985
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

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...
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
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
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...
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...
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 ...
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...
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...
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...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.