What is best practise for using .movelast .movefirst?

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

You do a MoveLast in order to make the RecordCount accurate.  If you access it before that, the results are unreliable.
You want to do a MoveLast, then a RecordCount, and only then a MoveFirst if the count is greater that zero.
That being said, the DataWindow is how people normally work with a database from PowerBuilder.

Similar Messages

  • Best Practises for using Content Types

    We had third party vendor who migrated and re structured contents and sites in Sharepoint 2010. I noticed one unusual thing : In most cases they new separate site content types for every library in a site i.e. even if two libraries contain same set of metadata
    columns they created separate site content types by duplicating it from the first one and gave it unique name and used in second library.
    My point of view for content type is that they are used for re usability, i.e. if another library is needing same set of metadata columns then I would just reuse existing content type rather than creating another content type with different name by inheriting
    it from the first one and having same set of columns.
    When I asked vendor reason for this approach (for every library they created new content types and for libraries needing same set of meta data columns they just inherited from a custom site content type and created another duplicate one with same set of
    meta data columns and gave it different name in most cases name of library ) they said they did that to classify documents which I did not agree with because by creating two document libraries classification is already done.
    I need some expert advice on this, I will really appreciate: I understand content types are useful and they provide re usability but,
     A) Do we need to create new site content types whenever we create new library ? (Even though we are not going to re use them)
    B) What is best practice : if few libraries are needing same set of metadata columns
    1) Create site a content type and reuse it in those libraries ? or
    2) Create a site content type and create new content types by inheriting from site content type created at first and just give them different name even though all of them are having same set of columns  ?
    I need expert advice on this but following is my own opinion on this
    I do not think point A) is a good practice and should not be used, we should create site content type only when we think it will be re used and we do not need to create site content type every time we create document library. Also I do not think point 2)
    of B is a good practice as well
    Dhaval Raval

    It depends on the nature of the content types and the libraries. If the document types really are shared between document libraries then use the same ones. If the content types are distinct and non overlapping items that have different processes, rules or
    uses then breaking them out into a separate content type is the way forward.
    As an example for sharing content types: Teams A and B have different document libraries. Both fill in purchase orders, although they work on different projects. In this case they use the same form and sharing a content type is the no question approach.
    As an example for different content types: A company has two arms, a consultancy where they send people out to client sites and a manufacturing team who build hardware. Both need to fill in timesheets but whilst the metadata fields on both are the same the
    forms are different and/or are processed in a different manner.
    You can make a case either way, i prefer to keep the content types simple and only expand out when there's a proven need and a user base with experience with them. It means that if you wanted to subdivide later you'd have more of a headache but that's a
    risk I generally think works out.

  • HT4152 What is best processor for using Adobe Creative Suite 5.5?

    About to purchase a laptop. Have strong committment to Apple products, so considering Apple's Macbook Pro, what should I request for graphics card or other customizable that will make use of Creative Suite smooth?

    >> There is no doubt that using Adobe Creative Suite
    has HUGE advantages.
    >> It does
    >> everything that Freehand used to do (the past tense
    is deliberate - it
    >> surely
    >> can't survive forever), and a whole lot more... plus
    more and more.
    >
    > This applies partly to Illustrator not to whole CS
    including InDesign
    > and Photoshop.
    Did I miss the point or what? Anyway it is a bit strange to
    compare
    FreeHand with CS package.
    There are still many things that are difficult to do with
    multiple
    programs that could be done just in FreeHand. Although
    FreeHand has quite
    poor body text controls (there are layout program like
    options but they do
    not really work) making for example a book jacket was more
    simple and
    faster. This is simply because area text in Illustrator is
    very slow and
    buggy as hell. Even the amount of text in the backcover can
    take a lot of
    time to adjust. Not to mention that Illustrator reflows text
    in random
    paragraps while making changes in just one.
    I could use InDesign and import all the images and graphic
    but that would
    be even slower.
    Like said I use Illustrator a lot and kinda like it
    sometimes, but the
    bugs are driving me nuts. Some of the bugs, still not fixed,
    appeared in
    version 10!!!!
    Jukka

  • What is best practice for using a SAN with ASM in an 11gR2 RAC installation

    I'm setting up a RAC environment. Planning on using Oracle 11g release 2 for RAC & ASM, although the db will initially be 10g r2. OS: RedHat. I have a SAN available to me and want to know the best way to utilise that via ASM.
    I've chosen ASM as it allows me to store everything, including the voting and cluster registry files.
    So I think I'll need three disk groups: Data (+spfile, control#1, redo#1, cluster files#1), Flashback (+control#2, redo#2, archived redo, backups, cluster files#2) and Cluster - Cluster files#3. So that last one in tiny.
    The SAN and ASM are both capable of doing lots of the same work, and it's a waste to get them both to stripe & mirror.
    If I let the SAN do the redundancy work, then I can minimize the data transfer to the SAN. The administrative load of managing the discs is up to the Sys Admin, rather than the DBA, so that's attractive as well.
    If I let ASM do the work, it can be intelligent about the data redundacy it uses.
    It looks like I should have LUN (Logical Unit Numbers) with RAID 0+1. And then mark the disk groups as extrenal redundancy.
    Does this seem the best option ?
    Can I avoid this third disk group just for the voting and cluster registry files ?
    Am I OK to have this lower version of Oracle 10gr2 DB on a RAC 11gr2 and ASM 11gr2 ?
    TIA, Duncan

    Hi Duncan,
    if your storage uses SAN RAID 0+1 and you use "External" redundancy, then ASM will not mirror (only stripe).
    Hence theoretically 1 LUN per diskgroup would be enough. (External redundancy will also only create 1 voting disk, hence only one LUN is needed).
    However there are 2 things to note:
    -> Tests have shown that for the OS it is better to have multiple LUNs, since the I/O can be better handled. Therefore it is recommended to have 4 disks in a diskgroup.
    -> LUNs in a diskgroup should be the same size and should have same I/O characteristica. If you now have in mind, that maybe your database one time will need more space (more disks) than you should use a disk size, which can easily be added, without waisting too much space.
    E.g:
    If you have a 900GB database then does it make sense to only use 1 lun with 1TB?
    What happens if the database grows, but only grows slightly above 1TB? Then you should add another disk with 1TB.... You loose a lot of space.
    Hence it does make more sence to use 4 disks á 250GB, since the "disks" needed to grow the disk groups can be extended more easily. (just add another 250G disk).
    O.k. there is also the possibility to resize a disk in ASM, but it is a lot easier to simple add an additional lun.
    PS: If you use a "NORMAL" redundancy diskgroup, then you need at least 3 disks in your diskgroup (in 3 failgroups) to be able to handle the 3 voting disks.
    Hope that helps a little.
    Sebastian

  • What is best practice for using Maintenance Optimizer to download SPS + EhP

    SAP indicates in note 1095233 and many other documents that the best practice is to implement an EhP along with an SP Stack in the same queue. Furthermore, the only way to download the components of an EhP is via Maintenance Optimizer. However, in step 2 (Calculate download files automatically) you must choose either Maintenance (SPS) or Enhancement Package Installation (EhP); there is no way to tell Maintenance Optimizer that you want to download both SPS and EhP.
    In developing the process for my team I circumvented the problem by saying to select Maintenance first to get the SPS into the Download Basket and follow that with selecting Enhancement Package Installation to get the EhP into the Download Basket. The plan would be to include all the downloads in the SPAM/SAINT queue with the expectation that SPAM/SAINT will be able to determine what must be included.
    I'm wondering now whether that is a legitimate way to approach this and I am hoping others will share their process.
    Thanks,
    Terry McCann
    Monsanto Company
    St. Louis, MO

    Actually, I don't believe you will get the entire SP Stack for ERP 6, you only get those pieces of the stack that are required for the Technical Usages you select for the EhP.  I'm basing that on my observation that you get a different subset of the files making up the stack depending upon your TU selection. Also, note 1095233 specifically states:
    If now the corrections included in the enhancement package 3 correspond to ERP 6.0 SP level 11, SAP  recommends to update also the parts of your system to SP level 11 which you do not want to update to enhancement package 3  to achieve a consistent correction level in all parts of your application: SAP recommends to update all software components to the correction status corresponding to SAP ERP 6.0 Support Package Stack 11 with the installation of SAP enhancement package 3 for SAP ERP 6.0.
    Thanks,
    Terry

  • What is best solution for using a Palm Tungsten 2 on a Windows 7 computer?

    Driven by the end of XP, I purchased an HP Z230 Workstation running Windows 7 Professional.   I'd like to get my Palm Tungsten 2 working, and I've heard several options here on doing that.
    OPTIONS
    A.  Use Palm Desktop 6.2 with Bluetooth for hotsync.  (I've done this already with a Win7 laptop, but I use the Note Pad utility a lot with some macros, which unfortunately is not supported on  Desktop v6.2).
    B.  Use Palm Desktop 4.1.4 in a virtual Windows XP environment running under Win 7.  I know I can do that, and that is probably my fallback.  However, Microsoft suggests that you disconnect from the Internet any time you use the Virtual XP, because it may be susceptible to hacking since they don't support XP anymore.   So that will be an added nuisance that I will probably forget to do.
    C.  Use the Aceeca USB driver to make Desktop 4.1.4 work.  I tried following the instructions here to do that, but when Hotsync fails, it never shows up as a yellow triangle in the device manager list, even after I followed the trick to make hidden devices visible.  So I have not been able to even try the Aceeca driver with Palm 4.1.4 yet.
    D.  Install the Aceeca Desktop 4.1 and update to their driver.  I could try this (uninstall Palm 4.1.4 and install Aceeca 4.1) but it looks like it depends on the same process to update the driver as my option C just above.  So I'm thinking I may run into the same roadblock as C.
    Questions:
    Does anyone have any other ideas of how to get the Aceeca driver hooked up to Palm Desktop 4.1.4 that I could try?
    Does anyone know if Aceeca Desktop supports the Note Pad facility if I try option D?
    Thanks in advance for your help.
    Terry
    This question was solved.
    View Solution.

    Palm Blue,
    Thanks for weighing in!
    Here is what I know so far.   I use the Palm Desktop 4.1 on my Win XP computer, and have no problems syncing my Tungsten T2 with USB Hotsyncs.
    I've also successfully hotsynced the T2 to a Win7 Pro laptop computer using Palm Desktop 6.2. and Bluetooth.
    My goal, which sounds like you have already accomplished, is to install Palm Desktop 4.1.4 on my new Win7 Pro desktop, so that I can sync with the T2 and get the Note Pad functionality also.   This is like my "OPTION C." 
    Did you have to use the Aceeca driver to make this work on your computer, or were you able to do it with the Palm driver?  One other person reported elsewhere having gotten 4.1.4 working on a 64 bit Win7 installation, and he made no mention of the Aceeca driver.  I have not been able to contact him.
    In response to your question about what I see when I try to sync:
    Palm 4.1.4 is installed on the Win7 Pro desktop, and the hotsync icon is present. 
    When I try to sync, I hear the characteristic tone indicating that a USB device is recognized.  But I also get a message that pops up near it with the yellow triangle and the following text:
    "USB DEVICE NOT RECOGNIZED"
    "One of the USB devices attached to this computer has
    malfunctioned, and Windows does not recognize it.
    For assistance in solving this problem, click this
    message."
    If I click the message, I get popup window that says,
    One of the devices attached to this comptuer has malfunctioned and Windows does not recognize it."
    It then shows a list of the USB devices inside of one of the USB Root Hubs, and one of them has a different icon and a question mark in that icon (not a yellow triangle).  And its description is in bold and it says "Unknown USB Device."
    I also looked at the Device Manager during a hotsync to see if it shows a Palm device or an Other category.   Using my XP computer first with the Tungsten T2, and which also syncs okay, it is true that during the Hotsync, the Device Manager adds a device "Palm OS Handheld Device / Palm Handheld," that goes away as soon as the hotsync is complete.
    Using the same Palm Tungsten 2, when I attempt the Hotsync in the Win7Pro computer,  "Palm OS Handheld Device/Palm Handheld"  does NOT appear in the Device Manager (nor anything else like it).
    So for some reason, my computer does not have seem to have enough of the Palm Desktop/Hotsync installation complete that I can get to the point of either it working, or where I could try to install the Aceeca driver.
    I keep trying things to get it to work, but so far now luck.  Looking for more ideas to try.
    Terry

  • Best practises for using Excel functions on Power Pivot Data

    Hi
    How do you suggest to perform calculations on cells in a power pivot table? Obviously the ideal approach is to use a DAX measure. But given that DAX doesn't have every function, is there a recommended way of eg adding an "extra"  ( ie just
    adjacent)  column to a pivot table. ( in particular I want to use beta.inv )  
    I could imagine one option of adding some VBA that would update the extra column as the pivot table itself refreshed ( and added more/less rows)
    thanks
    sean

    Hi Sean,
    I don't know what's your expected requirement regarding this issue, maybe you can share some sample data or scenario to us for further investigation. As we know, if we need to add extra column to PowerPivot data model, we can directly
    create a calcuated column:
    calculated columns:
    http://www.powerpivot-info.com/post/178-how-to-add-dax-calculations-to-the-powerpivot-workbooks
    There are some different between Excel and DAX functions, here are the list for your reference:
    Excel functions (by category):
    http://office.microsoft.com/en-us/excel-help/excel-functions-by-category-HA102752955.aspx
    DAX Function Reference:
    http://msdn.microsoft.com/en-us/library/ee634396.aspx
    Hope this helps.
    Regards, 
    Elvis Long
    TechNet Community Support

  • Best practises for replication

    Hi,
    I want to know what is best practise for duration of replicaation of database between two Cisco ACS.
    Regards,
    Atif.

    Hi Atif,
    The replication time interval should always be higher.
    Reason: Everytime you replicate the data it requires ACS services to restart so doing this frequently may affect your production enviroment.
    However, if you want to replicate internal user's password then there is an option to replicate password changes right awayvwithout a full replication.  You can enable this option under System Configuration -> Local Password Management.  With this enabled you could potentially set the replications to a larger interval.
    It also depend how often you do changes in your ACS. If its normal then I would say set it to every sunday 12:00 PM.
    This is how replication happens:
    The primary ACS stops its authentication and creates a copy of the ACSinternal database components that it is configured to replicate. During this
    step, if AAA clients are configured properly, those that usually use the primary ACS fail over to another ACS. The primary ACS resumes its authentication service.
    After the preceding events on the primary ACS, the database replication process continues on the secondary ACS. The secondary ACS stops its authentication service and replaces its database components with the database components that it received from the primary ACS. During this step, if AAA clients are configured properly, those that usually use the secondary ACS fail over to another ACS. The secondary ACS resumes its authentication service.
    HTH
    Regards,
    JK
    Plz rate helpful posts-

  • Best Practises for doing Master Scheduling using SNP

    Hello Gurus ,
                         Can you please suggest the best practises for doing Master Scheduling using SNP . Which engine to use , what would that mean etc
    Regards,
    Nick

    APC Back-UPS XS 1300.  $169.99 at Best Buy.
    Our power outages here are usually only a few seconds; this should give my server about 20 or 25 minutes run-time.
    I'm setting up the PowerChute software now to shut down the computer when 5 minutes of power is left.  The load with the monitor sleeping is 171 watts.
    This has surge protection and other nice features as well.
    -Noel

  • What is the best practice for using the Calendar control with the Dispatcher?

    It seems as if the Dispatcher is restricting access to the Query Builder (/bin/querybuilder.json) as a best practice regarding security.  However, the Calendar relies on this endpoint to build the events for the calendar.  On Author / Publish this works fine but once we place the Dispatcher in front, the Calendar no longer works.  We've noticed the same behavior on the Geometrixx site.
    What is the best practice for using the Calendar control with Dispatcher?
    Thanks in advance.
    Scott

    Not sure what exactly you are asking but Muse handles the different orientations nicely without having to do anything.
    Example: http://www.cariboowoodshop.com/wood-shop.html

  • What is the best  way for using a  C++ in the EJB?

    What is the best way for using C++ in the EJB ie
    either 1. Socket programming
    2. JNI

    To what purpose?
    To use C++ in the client you could generate IDL from your remote interfaces and run that through your vendor's IDL-to-C++ processor.

  • What is the best practise for setting dirty flag of a page/view?

    For a page/view, normaylly there are 2 things to do for diry data:
    1. when it's clean, Save button is disabled, when it's dirty, save button is enabled.
    2. when it's dirty and the window is closed, a popup says "you have unsaved data, close will lose the data".
    My thought is: it must be handled at client side, because not all valuechange is auto submitted. E.g., you type the 1st letter of a string in a input box, the server side does not know it, but save button should be enabled immediately.
    Is it possible to capture all valueChange events in a page or a view at client side?
    I'm not sure what is the best practise for setting dirty flag? If there is better solution? Does ADF provide facility for this?

    public void save(ActionEvent event){
    boolean formValid = isFormValid();
       if (formValid) {
      save button is enabled.
        private boolean isFormValid() {
            boolean valid = true;
            if (Check Condition 1) {
                valid = false;
               showErrorMessage1();
            if (Check Condition 2) {
                valid = false;
               showErrorMessage1();
            return valid;
        private void showErrorMessage1() {
                    when it's dirty and the window is closed, a popup says "you have unsaved data, close will lose the data".

  • Hi - was looking to buy a macbook air soon but wanted to get it with lion software....anyone know when that is available and second question is what is best software for personal money management that works with lion.....use quicken now   thanks

    Hi - was looking to buy a macbook air soon but wanted to get it with lion software....anyone know when that is available and second question is what is best software for personal money management that works with lion.....use quicken now   thanks

    quicken should work with lion.
    Quicken Essentials will work with Lion.  Most people that have used Quicken for a while (i.e. Quicken 2007) have found that Quicken Essentials isn't much better than a basic spreadsheet.  It is a significant step down from previous versions and does not offer many of the features previously offered.  Right now, it seems like the two most common options are iBank and MoneyDance.
    Frankly... this is a major opportunity for these companies.  The largest commercial distributor of this type of product has been Intuit (Quicken).  That makes it hard for any other company to get any of that market as so many people were already using Quicken and may have had years of data stored in it.  Now, with Quicken effectively out of the picture, it's a great chance for another company.  Just imagine if iPhones were suddenly off the market.  That would give other manufacturers a tremendous opportunity since they wouldn't have to fight an up hill battle against a market giant.

  • HT1229 what is the best method for using a iphoto with an external hard drive for greater capacity?

    what is the best method for using a iphoto with an external hard drive for greater capacity?

    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • What are the best practices for using the enhancement framework?

    Hello enhancement framework experts,
    Recently, my company upgraded to SAP NW 7.1 EhP6.  This presents us with the capability to use the enhancement framework.
    A couple of senior programmers were asked to deliver a guideline for use of the framework.  They published the following statement:
    "SAP does not guarantee the validity of the enhancement points in future releases/versions. As a result, any implemented enhancement points may require significant work during upgrades. So, enhancement points should essentially be used as an alternative to core modifications, which is a rare scenario.".
    I am looking for confirmation or contradiction to the statement  "SAP does not guarantee the validity of enhancement points in future releases/versions..." .  Is this a true statement for both implicit and explicit enhancement points?
    Is the impact of activated explicit and implicit enhancements much greater to an SAP upgrade than BAdi's and user exits?
    Is there any SAP published guidelines/best practices for use of the enhancement framework?
    Thank you,
    Kimberly
    Edited by: Kimberly Carmack on Aug 11, 2011 5:31 PM

    Found an article that answers this question quite well:
    [How to Get the Most From the Enhancement and Switch Framework as a Customer or Partner - Tips from the Experts|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0f0373e-a915-2e10-6e88-d4de0c725ab3]
    Thank you Thomas Weiss!

Maybe you are looking for