><<<snip>>>
>
>>>>In config.fpw SET RESOURCE OFF.
>>>>Very early in main.prg:
>>>>OldOnErr = ON('ERROR')
>>>>FileInUse = .F.
>>>>ON ERROR FileInUse = .T.
>>>>USE UserIDResource.dbf EXCLUSIVE
>>>>ON ERROR &OldOnErr
>>>>IF m.FileInUse
>>>> QUIT
>>>>ENDIF
>>>>USE IN UserIDResource.dbf
>>>>SET RESOURCE TO UserIDResource.dbf
>>>>SET RESOURCE ON
>
>>>
>>>What does the last "set resource on" do?
>>>
>>>Brenda
>
>>Um ... turns resource on ... I'm not sure I understand the question.
>
>>The line in config.fpw turns RESOURCE OFF, in other words, tells (Visual) FoxPro not to use a resource file at all. After you've determined that you'll be able to open it, you need to tell FoxPro you want to use it (as a resource file) after all.
>
>>A resource file is just a special dbf. (V)FP uses it internally in a special way. (To save and restore certain settings.) But you can tell (V)FP not to use it (which turns off the saving of the settings which it saves there) or tell it to use it. By default, it uses it.
>
>I understand everything you are saying. But by "SET RESOURCE TO UserIDResource.dbf" are you not setting resource on? Would the above code work the same without the "set resource on"?
>
>Brenda
No. SET RESOURCE has two types of settings.
1) SET RESOURCE TO myfile set the resource to a particular file.
2) SET RESOURCE ON/OFF You can temporarily turn off the resource file without losing which file that is.