Author: Juergen Wondzinski
Posted: 2001-01-25 at 03:03:43
Hi Fred,
>> You have to do a couple of things to access the FOXUSER.DBF like a table.
>> SET RESOURCE OFF
>> USE SYS(2005) EXCLUSIVE
Not neccessarily. You can also do (without SET RESO OFF):
USE SYS(2005) AGAIN ORDER 1
The FoxUser is (up to VFP6, at least) always in Exclusive Mode already. It
has also an index attached, which is always created new when VFP starts.
Unfortunately, the name is a Sys(2015) one, thus the numeric access of the
Order.
I use the FoxUser quite often, and store my own settings in it (Window
positions, Grid columns order, last used customer and such). And instead of
writing an INI file, or (shudder) clobbering the registry, this is the best
and fastest way to store personal data. (That's what VFP is known best for:
dbf access) And no need for extensive errorchecking, too: The foxuser is
always present, and has always a fresh index.
The index is on "Type + Id + LEFT(Name, 24)", thus I store the APP-Name to
Type, The Setting-IDs to ID and the username to Name. You then have a
Logical, a Date, a Numeric and a Memo field for your own free usage. FoxPro
doesn't care about entries he doesn't know. You shouldn't name your APP like
any of the used Type-fieldvalues of FoxPro, though <g>.
Starting with VFP7, the FoxUser is in Shared mode, thus the above concept
gets even better, because you then can have a central FoxUser, thus a moving
user has always his settings, regardless of the PC he's on. Try this with
Registry or INI entries....
ÃÂ Servus
ÃÂ ÃÂ ÃÂ wOOdy
ÃÂ |_/| ---- ProLib - programmers liberty -----
ÃÂ (.. ) Our 5ÃÂ MVPs make the Fox run... See us
ÃÂ - /ÃÂ at www.prolib.de or www.AFPages.com