Re: recno() and "Record is out of range"




"Hii Sing Chung" <singchung@xxxxxxxxxxx> schrieb im Newsbeitrag
news:1FC10069-534D-4FEB-ABC0-6FBC9D71729C@xxxxxxxxxxxxxxxx
Stefan,

Correct me if I am wrong, from the solution you provided, we are trying to locate the
recdno, if EOF encountered, then goto the top or bottom.

Yes. The difference between "Go To 3" and "Locate Record 3" is
that the latter will not cause an error if there is no 3rd row in the result
anymore, in the first place.

That is the current strategy I used, but it still hasn't solved the problem of returning
the record pointer to the original record we are working on. As I check for EOF, if
true, goto bottom, the user will always see the last record after she keyed in a new
record (or make modification of an existing record) and if I don't check EOF, it will
give "Record is out of range" error.
How do I make sure it will return me to the position of original record (in this case
the newly created record or just modified record)?

The problem may be that after requiring the row set, the former row
is not in the same position anymore, either because the queried table
was updated by another user, or because sequence may vary depending
on the new filter or an SQL Order By clause or Set Order To .

In that case, you may not want to use Recno() as a row identifier at all -
with any kind of SQL, it's a good idea to have a "surrogate primary-key"
column, say call it cust_id in a customers table and put some "meaningless"
unique values in there, for example a string like "025D53F4-5C29-C844-8E26-1EAEC7CD9C01"
that you'd get from the CoCreateGUID() API.


hth
-Stefan




--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------


.



Relevant Pages

  • Re: recno() and "Record is out of range"
    ... Correct me if I am wrong, from the solution you provided, we are trying to locate the recdno, if EOF encountered, then goto the top or bottom. ... As I check for EOF, if true, goto bottom, the user will always see the last record after she keyed in a new record and if I don't check EOF, it will give "Record is out of range" error. ...
    (microsoft.public.fox.vfp.forms)
  • Re: Obtaining Last Logon Time for Domain User
    ... Subject: Re: Last time each NT account was accessed ... > framework 1.1 to run this tool (you can get it from Windows Update). ... >> goto:EOF ...
    (microsoft.public.windows.server.active_directory)
  • Re: recognize EOF condition when using GoToRecord Action
    ... VB experts have specifically recommended that GoTo ... I would recommend putting your code lines in ... learning what error number arises on an EOF ... And we have recordsets when we need to be slow, ...
    (comp.databases.ms-access)
  • Re: Generate password from computer name
    ... 009.:: workstation to translate to a password. ... endlocal&goto:EOF ... goto:EXITING ... 032.:: Translate a string to upper case ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Batch file to delete old profiles, cant figure out where to set the parameters or how to output
    ... I'm trying to use a batch file to delete old profiles. ... goto:EOF ... SAPIEN Technologies - Scripting, Simplified.www.SAPIEN.com ...
    (microsoft.public.scripting.wsh)

Loading