Login
`
Templates, Tools and Utilities
|
||
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Par2: Testing for results after Fetch 1998-01-23 -- Jim Katz The Methods, Access:FileName.Fetch or Access:FileName.TryFetch are actually
functions, that is they do have return values that you can test for. They are declared
with the proc attribute so you don't have to use them as functions.
If you use the TryFetch method you can test for which error has been returned using
the old ErrorCode()and Error() functions:
If Access:MyFile.TryFetch(My:key)
Message('Errorcode is ' & ErrorCode() ! or
If Error() = 'Record Not Found'
Access:MyFile.ThrowMessage(FileErrorCode(),'Record Not Found')
End
Else
etc..
Be aware though, there are some known problems when using the Fetch or Tryfetch
methods with some file drivers. Check back through the Topspeed list, I think, it has to
do with Get(File,key) on certain drivers, which is what fetch is doing.
Today is November 21, 2024, 8:15 am This article has been viewed 35201 times.
|
|