Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Included or not
Message
From
14/07/2003 05:41:20
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
14/07/2003 05:07:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00809748
Message ID:
00809757
Views:
25
Hi Gregory,

I failed with that.

As far as I see you try to check if GetFileAttribute() returns a failure code.

You may achieve this result using build in ADIR
*--------------------------------------------------------------------------
Function	FileExists(FileName)

	return !EMPTY(ADIR(laDir,FileName))
endfunc
*--------------------------------------------------------------------------
I open the table from my exe and run your or my function with DBF() as parameter. It returns .T. (DBF() points to the position where the file is stored on my comp). It is definetly not the on the comp opend because this is ReadWrite and ISREADONLY(DBF()) returns .T.. The DBF() of the table included in the exe is the full path to the location where its compiled from.

If I try with just TheTableName.dbf it returns .F. what it should do because the table is not on the place where the exe is stored and not to find using PATH.

ISREADONLY() on the other hand will will not be of any use in this because the file on the comp may be readonly. (It's normale state in SourceSafe for me)

Agnes


>Guillaume,
>
>File() will return TRUE for both built-in/external tables/files
>
>FileExists() will return TRUE only for external tables/files (RunTime, this is)
>
>
>*--------------------------------------------------------------------------
>Function	FileExists(FileName)
>        declare Integer GetFileAttributes in win32api string @
>
>	return (GetFileAttributes(@FileName) <> -1)
>endfunc
>*--------------------------------------------------------------------------
>
>>Hi,
>>
>>Is there a way to determine if a certain table is included in the project or not? Before it is opened, I need to determine if it's a build-in or external table .
>>
>>Thanks again
>>
>>Guillaume
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform