Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Sep 22, 2018 2:35 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Recordset Values Disappear after it is used
PostPosted: Sun Mar 24, 2013 12:58 pm 
Offline

Joined: Sat Jul 24, 2010 12:20 am
Posts: 52
I hope someone has an explanation of this.

I create a recordset, send that to a function to load a list box - All works fine

Imediatly after I send the record set to a function to create an excel file and there are no values in the recordset. It shows a record count, but no values.

I'm using MySql.

So:

LoadListbox(MyRecordset) <-----Listbox get populated fine

Make Excel(MyRecordset) <----- No data in record set

Now reverse the calls:

Make Excel(MyRecordset) <----- Excel file gets created fine

LoadListbox(MyRecordset) <-----Listbox is blank

Does anybody know whats happening????

Is this a OneWay Cursor?

Thanks

Rich


Top
 Profile  
Reply with quote  
 Post subject: Re: Recordset Values Disappear after it is used
PostPosted: Sun Mar 24, 2013 1:45 pm 
Offline

Joined: Mon Aug 14, 2006 9:33 pm
Posts: 1774
My guess is that your recordset has gone out of scope. Without the code as to how you are creating it and/or passing it I can't be sure.

_________________
Roger Clary
Class One Software
Educational Software for Lifelong Learning
http://www.classonesoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Recordset Values Disappear after it is used
PostPosted: Sun Mar 24, 2013 1:55 pm 
Offline

Joined: Sat Jul 24, 2010 12:20 am
Posts: 52
No that's not it, here's sudo code:

dim rs as recordset

rs = gDB.SQLSelect(lsSql)


if gDB.Error then
MsgBox "Database Error: " + str(gDB.ErrorCode) + EndOfLine + EndOfLine + gDB.ErrorMessage
Return
end


if rs = nil or rs.RecordCount = 0 then
MsgBox( "No records found")
lblResult.Text = "No records found matching the search paramiters. "
return
end


LoadResults(rs)
DOrs2xls(rs, msFileName, True, True, "", nil)


So it's not scope.


Top
 Profile  
Reply with quote  
 Post subject: Re: Recordset Values Disappear after it is used
PostPosted: Sun Mar 24, 2013 5:13 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
and YES with some database's it IS a one way cursor... (and I *think* mySQL is one of those)

and even in those where it is BI-Directional you need to execute an RS.MOVEFIRST to start over again

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Recordset Values Disappear after it is used
PostPosted: Sun Mar 24, 2013 5:37 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
MySql creates a single-use recordset.


Top
 Profile  
Reply with quote  
 Post subject: Re: Recordset Values Disappear after it is used
PostPosted: Sun Mar 24, 2013 8:24 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Hawkcode wrote:

Is this a OneWay Cursor?

Rich


Yes - you can read it forwards once

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group