Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instance Runtime as Object ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00753457
Message ID:
00753851
Vues:
25
This message has been marked as the solution to the initial question of the thread.
If you have the runTime installed just create a project called VfpUtil (or whatever name you want) with this single .prg compile it to a dll.
Define Class VFPScript As Session OLEPUBLIC 

	Function ExecuteScript( cScript )

		Local loErr

		Try
			=ExecScript(cScript) 
		Catch to loErr
			ComReturnError(loErr.Message)
		EndTry 

	EndFunc


EndDefine 
Then, you can call it just like this:
oVfp = CreateObject("VFPUtil.VfpScript")
Text To lcScript NoShow
  OPEN DATABASE insert-full-path-to-DBC EXCLUSIVE
  PACK DATABASE
EndText 

oVfp.ExecuteScript( lcScript)
oVfp = null
HTH

>From an earlier thread I was in, it was recommended I try this once to do a PACK:
>
>oVFP = CREATEOBJECT('VisualFoxpro.Application.6')
>oVFP.DoCmd('OPEN DATABASE insert-full-path-to-DBC EXCLUSIVE')
>oVFP.DoCmd('PACK DATABASE')
>RELEASE oVFP
>
>
>That only works if the VFP6 IDE is installed on the machine, which isn't possible on a production server.
>
>I'm just wondering if it is possible (or rather, what redistributables would be needed) to do this with VFP8 now.
>
>Thanks.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform