Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing General field data
Message
From
23/11/2004 16:29:16
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00963898
Message ID:
00964041
Views:
8
I will test this and see how it goes. Thank you Yuri.

>See if this help:
>
>
>
>use your_table
>GO (record_number)
>Genfiedname= "General_field_name"
>
>local oForm
>oForm = Createobject('_Form',Genfiedname)
>oForm.myOLe1.refresh
>=oForm.myOle1.DoVerb(1)
>
>oShell = CreateObject("WScript.Shell")
>lcWindowTitle="Object Packager - Package in"
>lnstart=SECONDS()
>DO WHILE SECONDS()-lnstart <60 AND NOT oShell.AppActivate(lcWindowTitle)
>	WAIT WINDOW TIMEOUT 1.0 "Loading... Please, wait..."
>ENDDO
>* Save contents as ZIP file
>IF oShell.AppActivate(lcWindowTitle)
>	lcfilename="c:\filename.zip"
>	erase (lcfilename)
>	oShell.SendKeys("%FS"+lcfilename)
>	oShell.SendKeys("{ENTER}")
>	lnstart=SECONDS()
>	DO WHILE SECONDS()-lnstart <60 AND NOT FILE(lcfilename)
>		WAIT WINDOW TIMEOUT 1.0 "Saving... Please, wait..."
>	ENDDO
>	oShell.SendKeys("%Fx")
>endif
>
>oForm.release
>oShell=.null.
>RETURN
>*----------------
>Define Class _Form As Form
>	PROCEDURE iNIT
>		LPARAMETERS pGenFieldName
>		this.addobject('myOLe1',"OleBoundControl")
>		this.myole1.ControlSource = ALIAS()+'.'+pGenfieldName
>	ENDPROC
>Enddefine
>
>
>
>>Hi all,
>>How do I 'extract' data from a General field? For example:
>>
>>* Table: TestGeneral (Fld i, FldGen g).
>>* I added a zip file using the following commands:
>>append blank
>>append general FldGen from 'd:\test\test.zip' class winzip
>>
>>All is fine. I can browse the table, double-click on the General field which opens up a window containing the zip file. While the editor window is open, I can select from the menu: Edit->Package Object->Active Contents which starts winzip and with the zip file.
>>Aside from putting an OleBound control on a form, can I programmatically extract the data to a file?
ramil
~~ learning to stand still
Previous
Reply
Map
View

Click here to load this message in the networking platform