Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use non VFP events
Message
From
26/06/2002 21:55:01
 
 
To
26/06/2002 19:54:57
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00671914
Message ID:
00672761
Views:
9
Antonio,

i put netx codes before
>oEvents = CREATEOBJECT("DTSEvents")


For nStepCount = 1 To dtspkg.Steps.Count
dtspkg.Steps(nStepCount).ExecuteInMainThread = .t.
Next nStepCount



event PackageEvents_OnQueryCancel was fired , but i got this error when
RETURN from this event
AND
PackageEvents_OnStart
PackageEvents_OnProgress NOT FIRED !
it is strange

Thanks
Andrey



>Antonio,
>
>i have run its program in server where SQL was installed
>
>codes below:
>
>***********************************************************
>public oEvents,dtspkg,pbCancel
>
>lcrep='Bank_cb' && or any own package
>
>dtspkg=createobject('dts.package')
>if type("dtsPkg")<>"O" or isnull(dtspkg)
> messagebox("can't create dts.package!",16,"** import tables of REPCB **")
> return .f.
>endif
>* On Error lcdtsError=.t.
>
>dtspkg.failonerror = .t.
>
>
>lccom="dtsPkgName=dtsPkg.LoadFromSQLServer('TBNTS40BNT03','RPADMIN','RPADMIN',,,,,'"+ lcrep+"') " && need use own server , owner, password
>
>
>&lccom
>
>if dtspkg.failpackageonlogfailure
> messagebox("load DTS pasckage "+ lcrep+" finished with errors. !",16,"** import tables of REPCB **")
>endif
>
>
>oEvents = CREATEOBJECT("DTSEvents")
>if EVENTHANDLER(dtspkg, oEvents )
>oRS=dtspkg.execute && error here
>endif
>return
>
>
>DEFINE CLASS DTSEvents AS session
>
>IMPLEMENTS PackageEvents IN "dts.package"
>
>procedure PackageEvents_OnStart(EventSource As string @) AS string
> ? "oPackage_OnStart Fired"
>
>procedure PackageEvents_OnFinish(EventSource As string @) AS string
> ? "oPackage_OnFinish Fired"
>
>procedure PackageEvents_OnError( EventSource As string @, ;
> ErrorCode As Number @, ;
> Source As string @, ;
> Description As string @, ;
> HelpFile As string @, ;
> HelpContext As Number @, ;
> IDofInterfaceWithError As string @,;
> pbCancel As LOGICAL @) AS string
>* wait window "oPackage_OnError" nowait
> ? "oPackage_OnError"
>
>procedure PackageEvents_OnProgress( EventSource As string @, ;
> ProgressDescription As string @, ;
> PercentComplete As Number @, ;
> ProgressCountLow As Number @, ;
> ProgressCountHigh As Number @) AS string
>
>* wait window "oPackage_OnProgress Fired" nowait
> ? "oPackage_OnProgress Fired"
>
>*!* procedure PackageEvents_OnQueryCancel(EventSource As string @, ;
>*!* pbCancel As LOGICAL @) AS string
>
>procedure PackageEvents_OnQueryCancel(EventSource As string @, ;
> pbCancel As LOGICAL @)
>
>* wait window "oPackage_OnQueryCancel Fired" nowait
>* ? "oPackage_OnQueryCancel Fired"
>
>a=1 && ERROR here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>? str(a)
>*!* b=2
>*!* ? str(b)
>*!* c=3
>*!* ? str(c)
>
>enddefine
>****************************************************
>
>
>
>>Andrey:
>>
>>In fact, I have never used EventHandler with a dts Package. It seems to be a permissions or an installation problem. Are you running your code in the server itself or in another workstation ?.
>>
>>If you post the code that give you the error, I can try it here ...
>>
>>>Antonio,
>>>thanks for your response
>>>i see, but i get new error EXCEPTION_ACCESS_VIOLATION
>>>when DTS events fire
>>>is it new for you?
>>>
>>>
>>>>Andrey
>>>>
>>>>If you are using VFP 7, you can use the EventHandler() function.
>>>>
>>>>In VFP 6, you have to use the VFPCom .dll
>>>>
>>>>
>>>>>Hi,
>>>>>can i use non VFP events in VFP anyhow?
>>>>>for sample MS SQL DTS Packages events
>>>>>
>>>>>Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform