DB Tools Fetch Next Recordset

This is a discussion on DB Tools Fetch Next Recordset within the labview forums in Programming Languages category; I am having trouble iterating through the set of recordsets returned from a query that returns multiple tables.  I am using the DB Tools Fetch Next Recordset.vi in a loop to iterate through recordsets until they have all been processed.  One problem I have is that there is no indication that you have iterated past the end of recordsets.  DB Tools Fetch Next Recordset does not produce an eof type indication like you get when iterating through records in a recordset.   My code is attached: 1.  Open a database and execute a query that returns more than 1 table ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-25-2008, 10:40 AM
10Degree
Guest
 
Default DB Tools Fetch Next Recordset

I am having trouble iterating through the set of recordsets returned from a query that returns multiple tables.  I am using the DB Tools Fetch Next Recordset.vi in a loop to iterate through recordsets until they have all been processed.  One problem I have is that there is no indication that you have iterated past the end of recordsets.  DB Tools Fetch Next Recordset does not produce an eof type indication like you get when iterating through records in a recordset.
 
My code is attached:
1.  Open a database and execute a query that returns more than 1 table (SELECT * FROM tblA SELECT * FROM tblB)
2.  Fetch the current recorset data and store in array.
3.  Use DB Tools Fetch Next Recordset to move to the next recordset.
Question:  What is the stop condition to test for?
 
Errors propogate through to the close vi which reports:
 
Error 97 occurred at Rec Get Recordset Properties (R).vi->Rec Fetch Recordset Data (R).vi->Untitled 1
Possible reason(s):Unknown System Error in Rec Get Recordset Properties (R).vi->Rec Fetch Recordset Data (R).vi->Untitled 1
 
Any help or example for navigating recordsets?
Thanks,
-cb


Iterate recordsets3.png:
http://forums.ni.com/attachments/ni/...4030/1/Iterate recordsets3.png
Reply With Quote
  #2  
Old 07-29-2008, 05:40 PM
Captain Kirby
Guest
 
Default Re: DB Tools Fetch Next Recordset

Hi, I believe you can still use the "DB Tools Get Properties" Vi to return either the number of recordsets, or an end of file condition (meaning you have reached the end of your recordsets.) This VI returns different parameters in its output cluster depending on the reference passed to it. Passing it a single recordset refrence, or a group of recordsets, should return the same data elements, and you can poll these elements in a loop to determin the stop condition.I would still suggest experimenting with this VI, as I have not implemented it myself, and so I dont know exactly what you will get in the properties cluster.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 10:07 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.