>>>This code piece was taken from an MS site article and on top was saying "....using this code". If it wasn't MS itself I would think a mistyping or personal code.
CLEAR
>>> DO CASE
>>> CASE "6.0"$VERSION()
>>> lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>>> "Exclusive=No;SourceType=DBF;SourceDB="+HOME(2)+"DATA"
>>> CASE "5.0"$VERSION()
>>> lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>>> "Exclusive=No;SourceType=DBF;SourceDB="+HOME()+"SAMPLES\DATA"
>>> CASE "3.0"$VERSION()
>>> lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>>> "Exclusive=No;SourceType=DBF;SourceDB=D:\VFP30\SAMPLES\DATA"
>>> ENDCASE
Cetin
>>
>>If this is a qustion, it's building a connect string using directories that are available in more certain fashions on a version-specific basis; 6 provides the HOME(2) to locate the Samples directory (if its installed), 5 relies on the samples being installed by default to the SAMPLES folder beneath VFP's base installation directory, and 3 required you to guess, since I think you had to install the samples by hand. I'd be willing to bet in gets used to make an ODBC connection somewhere... :-)
>>
>>If you find the code annoying, I agree completely; it's not an example of overwhelmingly good coding technique, since it isn't even testing to see if the directroy in question exists before referencing it!
>>
>>Bletch.
>I wondered why it was not home() but "d:\VFP30" in version 3. I have been using home() before 3.0 :) Maybe in 3.0 samples were only for those having a CD as drive D:-)
I vaguely remember that you had to do something manual to install the samples, so there wasn't a predictable location under 3.0; it's been a long time since I looked at the samples under 3...