Foxpro Row Number Tip

There’s a ton of useful commands available in Visual FoxPro. It’s a pretty good database. The drawback is it’s a little slow, and the table size is limited, and obviously it costs money, unlike MySQL. There’s time that you might need to add a row number or record number to a FoxPro table. Still FoxPro is a great back end for Windows applications, as long as the databases are kept bloat free, and relatively small and well maintained. I’ve been using it for over ten years and it’s never let me down. It runs particularly well as a back end database solution when coupled with the Microsoft OLEDB Privider for Microsoft Visual FoxPro.

replace all id with recno()

this will add the numeric value to the field "id". Or alternatively, you can use this for character (text) fields.

replace all id with alltrim(str(recno()))
This entry was posted in Database / SQL and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>