Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Storing' Files in DBF files
Message
From
26/09/2011 23:05:53
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01524682
Message ID:
01524782
Views:
47
>>>>Hi All:
>>>>
>>>>My client wants to associate JPG, XLS and DOC files with his customer database. I was thinking of storing the name in a field and then invoking the right program via office automation when he requests it. Any references that anyone can point me to in helping me with this project?
>>>>
>>>>As far as I know, a GENERAL field only handles pictures. Is this right?
>>>>
>>>>Thanks,
>>>>
>>>>Yossi
>>>
>>>You can store blob data in the database (memo (binary)), but the recommended method is to store FileName (if you don't need to store path) and then you can use ShellExecute with default open action to open the file.
>>
>>Naomi:
>>
>>Could you give me an example of a SHELLEXECUTE command with, say, the following file name:
>>
>>c:\bob\documents\DocA.doc
>
>This worked for me:
>
>
>* Sample use:
> MyFile = 'C:\Users\Naomi\Downloads\OVER_Clause_and_Ordered_Calculations.doc'
> RunDoc(MyFile)
>
>FUNCTION RunDoc(tcDocument)
>	local lnResult
>
>	DECLARE INTEGER ShellExecute ;
>		IN SHELL32.dll ;
>		INTEGER nWinHandle, ;
>		STRING cOperation, ;
>		STRING cFileName, ;
>		STRING cParameters, ;
>		STRING cDirectory, ;
>		INTEGER nShowWindow
>
>	**retreive the main VFP window handle (this handle is used by ShellExecute)
>
>		lnResult=ShellExecute(_screen.hwnd, "Open", tcDocument, "", "c:\temp\", 1)
>
>	**Error messages if the return value is < 32
>	IF lnResult < 32
>		DO CASE
>		CASE lnResult=2
>			Wait wind "Invalid association or URL."
>		CASE lnResult=31
>			Wait wind "No association."
>		CASE lnResult=29
>			Wait wind "Can't start application."
>		CASE lnResult=30
>			Wait wind "Application already open."
>		ENDCASE
>	ENDIF
>ENDFUNC
>
>
>from
>Open any document FAQ #8134

Naomi:

Oops! I forgot to mention that my client is using VFP 5!

I got an error after:
lnResult=ShellExecute(_screen.hwnd, "Open", tcDocument, "", "c:\temp\", 1)
Property HWND not found
?????

Thanks,

Yossi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform