Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing General field data
Message
 
À
23/11/2004 11:56:49
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00963898
Message ID:
00964006
Vues:
8
This message has been marked as a message which has helped to the initial question of the thread.
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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform