Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 7329

What is best practise for using .movelast .movefirst?

$
0
0

I was told at some point that I should always execute a .movelast   then .movefirst before starting to work on a recordset, so that I was sure all records were loaded.  But if there are NO records, I get a "no current record" when the .MoveLast statement is executed in the following code.  But if I use rstClassList.RecordCount before the .movelast, can I count on it's being valid?

 

Also, I was unable to paste this code into this post.  I had to re-type it.  Is that expected behavior? Not to be able to paste stuff in?

 

ls_sql = "Select * from tblStudents"

Set rstClassList = CurrentDb.OpenRecordset(ls_sql)

rstClassList.MoveLast

rstClassList.MoveFirst

li_count = rstClassList.RecordCount

 

TIA

LAS


Viewing all articles
Browse latest Browse all 7329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>