Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Sunday, March 25, 2012

ActiveX Script Task] Error:

Hi,
I'm trying to reset the below Global varialbe in SSIS - Activex script.

Function Main()
DTSGlobalVariables("GxvFilename").value =null
Main = DTSTaskExecResult_Success
End Function

Getting the below Error when executing the package.

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x060339E4

Please provide me solution for this.

Thanks,

You can read and write global variables from ActiveX Script, but I have to ask why bother when you have the much more powerfull VB.net in the Script Task.

I don't belive null is a valid keyword in VBScript. Nothing is more usual, and use a Set statement. Saying all that I tried and got the same error. Unless anyone can come up with something better I'd say this is a backward compatability issue, and you woudl be better off moving to the Script Task.

|||

Thanks Darren,

The Activex Script is not working as like SQL 2000. We nee to use " " instead of null for resting the global variables.
MS need to give some reasonable error message for this kind of error.

Anyway I made it work in Activex Script iteself.

ActiveX Script Task] Error:

Hi,
I'm trying to reset the below Global varialbe in SSIS - Activex script.

Function Main()
DTSGlobalVariables("GxvFilename").value =null
Main = DTSTaskExecResult_Success
End Function

Getting the below Error when executing the package.

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x060339E4

Please provide me solution for this.

Thanks,

You can read and write global variables from ActiveX Script, but I have to ask why bother when you have the much more powerfull VB.net in the Script Task.

I don't belive null is a valid keyword in VBScript. Nothing is more usual, and use a Set statement. Saying all that I tried and got the same error. Unless anyone can come up with something better I'd say this is a backward compatability issue, and you woudl be better off moving to the Script Task.

|||

Thanks Darren,

The Activex Script is not working as like SQL 2000. We nee to use " " instead of null for resting the global variables.
MS need to give some reasonable error message for this kind of error.

Anyway I made it work in Activex Script iteself.

ActiveX Script Task/Function Not Found

We have a SQL Server 2005 Cluster that we are trying to send email from to notify when certain jobs have completed, failed, etc. We are having a bit of a problem getting the email to work and I believe that the failure is at the SMTP server, not at the SQL level.

That being said, I'm trying to create a simple SSIS package that I can use to test connectivity to the SMTP server with and send email. I've added an ActiveX Script Task that calls a COM object that actually sends the email. I keep getting a "Function not found." error when I try to execute the package, and I have no idea why I'm getting that. It says that the errors were found during validation.

Can anyone help?

Function not found is most likely the result of an invalid reference.

However, we do not recommend using the ActiveX script task - it is only for backwards compat. Better to move to the Script task which uses VB.Net and which enables a much better development and debugging experience.

Donald

ActiveX Script Task being ran twice?

I currently have a DTS package that contains an ActiveX Script Task. This script creates a report and saves the report in the database (for scalability reasons.) When I execute the step in Enterprise Manager it generates two entries in the database, it should only create one. If I take the script out of the DTS package and run it using CScript.exe it only creates one entry in the database.

Has anyone run into this problem before? Could I have done anything to the package that would cause it to execute the ActiveX Script Task twice?

Thanks for any advice to resolve this issue.

Have a great day,

CraigI figured it out, I was making the following call, "Call Main()" in my script and didn't realize that by default DTS packages call Main().

ActiveX Script Task - SSIS

Within a SQL 2000 DTS Package I have an ActiveX Script that would go within my transform tasks and update the queries by concatenating a "Where" clause with a date from a database table. This way I could keep track of when the last time I updated the table so that I could only bring down the rows since the last run. How can this be done within SSIS? I've been looking and I'm getting confused. Any help would be greatly appreciated.

The most analogous thing to an ActiveX Script in SSIS is the script component but that isn't what you want to use here. Instead, set the SQL statement that pulls data from your source dynamically like so: http://blogs.conchango.com/jamiethomson/archive/2005/12/09/2480.aspx

-Jamie

|||

Jamie,

Thank you for your response. We went ahead and used a data flow with a RecordSet Destination. Then we used a "ForEach" loop to cycle through the RecordSet and run our query based on each value and then stored the data in a raw table.

Thanks again for all your help on this issue and others.

Jerry

sql

ActiveX Script Task - Help!

I have a script that is run in Excel or Access that automatically runs the code I have cut/pasted below. I attempted to cut/paste into an activeX task, but doesn't work. Would anyone be able to convert this to vbscript?
Thank you in advance for your help,
clutch
Attribute VB_Name = "CD-1291"
Option Compare Database
Option Explicit
Public Function CD1291()
On Error GoTo CD1291_Err
Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d As String, L1, L2, sd As Date
d = Application.CurrentProject.Path
If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
Y = Year(Now() - 1)
M1 = Month(Now() - 1)
If M1 < 10 Then
M1 = "0" & M1
End If
M2 = Month(Now() - 1)
If M2 < 10 Then
M2 = "0" & M2
End If
D1 = Day(Now() - 1)
If D1 < 10 Then
D1 = "0" & D1
End If
D2 = Day(Now() - 1)
If D2 < 10 Then
D2 = "0" & D2
End If
'MsgBox Y & "-" & M1 & "-" & D1
p = Application.CurrentProject.Path
''' MSL
Open p & "\CD1291.msl" For Output As #1
Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID '" & Y & M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 & "0" & Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
Print #1, "CLOSE"
Print #1, "RUN '" & p & "\CD1291.bat'"
Print #1, "EXIT"
Close #1
''' MOD
Open p & "\CD1291.mod" For Output As #1
Print #1, "MFWMOD12"
Print #1, "~Description"
Print #1, "Premier Bankcard, Inc."
Print #1, ""
Print #1, "~Settings"
Print #1, "M/D/Y"
Print #1, "50"
Print #1, "."
Print #1, "0"
Print #1, "1"
Print #1, "1"
Print #1, ","
Print #1, "0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "Y"
Print #1, "~ExtendedSettings"
Print #1, "42"
Print #1, "N"
Print #1, "(Null)"
Print #1, "1"
Print #1, "1"
Print #1, "128128255"
Print #1, "128,32,96"
Print #1, "255,0,255"
Print #1, "160,0,224"
Print #1, "64128128"
Print #1, "255,0,128"
Print #1, "128128128"
Print #1, "85,85,255"
Print #1, "128,0,128"
Print #1, "193,0,193"
Print #1, "255115115"
Print #1, "128,64,255"
Print #1, "0,128,0"
Print #1, "128,64,64"
Print #1, "255,0,0"
Print #1, "255191255"
Print #1, "255255255"
Print #1, "225225225"
Print #1, "151151151"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "12"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "8"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "~TableField"
Print #1, "Acct #"
Print #1, "16"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "16"
Print #1, "3"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Acct #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Pymt Date"
Print #1, "10"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "10"
Print #1, "4"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "5"
Print #1, "0"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Pymt Date"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Payment"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "19"
Print #1, "5"
Print #1, "N"
Print #1, "N"
Print #1, "19"
Print #1, "5"
Print #1, "0"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Payment"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Amount"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "16"
Print #1, "6"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "53"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Amount"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Strat ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "7"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "70"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Strat ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Line"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "8"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "80"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Line"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Actn ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "9"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "86"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Actn ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr #"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "10"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "96"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr Data"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "11"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "108"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr Data"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float %"
Print #1, "18"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "5"
Print #1, "12"
Print #1, "N"
Print #1, "N"
Print #1, "5"
Print #1, "5"
Print #1, "0"
Print #1, "119"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float %"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Q Prio"
Print #1, "2"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "2"
Print #1, "13"
Print #1, "N"
Print #1, "N"
Print #1, "2"
Print #1, "5"
Print #1, "2"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Q Prio"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "3"
Print #1, "14"
Print #1, "N"
Print #1, "N"
Print #1, "3"
Print #1, "5"
Print #1, "2"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Rpt"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "7"
Print #1, "1"
Print #1, "N"
Print #1, "N"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Rpt"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Date"
Print #1, "8"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "D"
Print #1, "0"
Print #1, "12"
Print #1, "2"
Print #1, "N"
Print #1, "N"
Print #1, "14"
Print #1, "0"
Print #1, "0"
Print #1, "107"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Date"
Print #1, "3"
Print #1, "N"
Print #1, "1"
Print #1, "1"
Print #1, "~Level"
Print #1, "0"
Print #1, ""
Print #1, "1"
Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA FIRST PREMIER BANK -FD- 01/09/04 PAGE 1 "
Print #1, "2"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "0"
Print #1, "2"
Print #1, "Page Header"
Print #1, "N"
Print #1, "N"
Print #1, "~Level"
Print #1, "5"
Print #1, "???????????"
Print #1, "3"
Print #1, "5149860001000015 2004/01/09 5.00 5.00 0002 0009 0001 0000 0000 100 "
Print #1, " QUEUE PRIO FLOAT CYCL "
Print #1, " 00 011 "
Print #1, "12"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "5"
Print #1, "2"
Print #1, "Detail"
Print #1, "N"
Print #1, "N"
Print #1, "~PageSetup"
Print #1, "1"
Print #1, "256"
Print #1, "10"
Print #1, "50"
Print #1, "50"
Print #1, "2"
Print #1, "Y"
Print #1, "Y"
Print #1, "Y"
Print #1, ""
Print #1, "~PageSetupExtended"
Print #1, "1"
Print #1, "Y"
Print #1, "~End"
Close #1
'''PRJ
Open p & "\CD1291.prj" For Output As #1
Print #1, "MFWPRJ01"
Print #1, "[RefreshDDR]"
Print #1, "[InputFile]"
Print #1, p & "\CD1291.RPT"
Print #1, "[ModelFile]"
Print #1, p & "\CD1291.mod"
Print #1, "[ViewTable]"
Print #1, "[SummaryNoChart]"
Print #1, "[Author]"
Print #1, "[Description]"
Print #1, "[ASCII]"
Print #1, "[End]"
Close #1
''' BAT
Open p & "\CD1291.bat" For Output As #1
Print #1, "@.echo off"
Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
Print #1, "del " & p & "\CD1291.TMP"
Close #1
'''Execute
Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl /E")
Pause (30)
Loop
Do Until Dir(p & "\CD1291.TMP") = ""
DoEvents
Loop
Pause (5)
If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyzer.exe " & p & "\CD1291.prj " & p & "\CD1291.ASC")
Pause (5)
L1 = 1
Do Until L1 = L2
Open p & "\CD1291.ASC" For Random As #1
L1 = LOF(1)
Close #1
Pause (5)
Open p & "\CD1291.ASC" For Random As #1
L2 = LOF(1)
Close #1
Loop
Pause (5)
If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
End Function
You are going to have some very hard work cut out for you here. There is no
application class in VBScripting. There is no DIR() function. There is no
Kill function. You may want to transfer code to VB.net and then have DTS run
an application.
Andrew C. Madsen
Information Architect
Harley-Davidson Motor Company
"clutch" <clutch@.discussions.microsoft.com> wrote in message
news:974122A0-6D23-4C82-BA82-2FCBAF8D2716@.microsoft.com...
> I have a script that is run in Excel or Access that automatically runs the
code I have cut/pasted below. I attempted to cut/paste into an activeX task,
but doesn't work. Would anyone be able to convert this to vbscript?
> Thank you in advance for your help,
> clutch
> Attribute VB_Name = "CD-1291"
> Option Compare Database
> Option Explicit
> Public Function CD1291()
> On Error GoTo CD1291_Err
> Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d
As String, L1, L2, sd As Date
>
> d = Application.CurrentProject.Path
> If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
> If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
> If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
> If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
> If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
> If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
> Y = Year(Now() - 1)
> M1 = Month(Now() - 1)
> If M1 < 10 Then
> M1 = "0" & M1
> End If
> M2 = Month(Now() - 1)
> If M2 < 10 Then
> M2 = "0" & M2
> End If
> D1 = Day(Now() - 1)
> If D1 < 10 Then
> D1 = "0" & D1
> End If
> D2 = Day(Now() - 1)
> If D2 < 10 Then
> D2 = "0" & D2
> End If
> 'MsgBox Y & "-" & M1 & "-" & D1
> p = Application.CurrentProject.Path
> ''' MSL
> Open p & "\CD1291.msl" For Output As #1
> Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID
'" & Y & M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 &
"0" & Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
> Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
> Print #1, "CLOSE"
> Print #1, "RUN '" & p & "\CD1291.bat'"
> Print #1, "EXIT"
> Close #1
> ''' MOD
> Open p & "\CD1291.mod" For Output As #1
> Print #1, "MFWMOD12"
> Print #1, "~Description"
> Print #1, "Premier Bankcard, Inc."
> Print #1, ""
> Print #1, "~Settings"
> Print #1, "M/D/Y"
> Print #1, "50"
> Print #1, "."
> Print #1, "0"
> Print #1, "1"
> Print #1, "1"
> Print #1, ","
> Print #1, "0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "Y"
> Print #1, "~ExtendedSettings"
> Print #1, "42"
> Print #1, "N"
> Print #1, "(Null)"
> Print #1, "1"
> Print #1, "1"
> Print #1, "128128255"
> Print #1, "128,32,96"
> Print #1, "255,0,255"
> Print #1, "160,0,224"
> Print #1, "64128128"
> Print #1, "255,0,128"
> Print #1, "128128128"
> Print #1, "85,85,255"
> Print #1, "128,0,128"
> Print #1, "193,0,193"
> Print #1, "255115115"
> Print #1, "128,64,255"
> Print #1, "0,128,0"
> Print #1, "128,64,64"
> Print #1, "255,0,0"
> Print #1, "255191255"
> Print #1, "255255255"
> Print #1, "225225225"
> Print #1, "151151151"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "12"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "8"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "~TableField"
> Print #1, "Acct #"
> Print #1, "16"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "16"
> Print #1, "3"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Acct #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Pymt Date"
> Print #1, "10"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "10"
> Print #1, "4"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "5"
> Print #1, "0"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Pymt Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Payment"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "19"
> Print #1, "5"
> Print #1, "N"
> Print #1, "N"
> Print #1, "19"
> Print #1, "5"
> Print #1, "0"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Payment"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Amount"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "16"
> Print #1, "6"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "53"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Amount"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Strat ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "7"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "70"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Strat ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Line"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "8"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "80"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Line"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Actn ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "9"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "86"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Actn ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr #"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "10"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "96"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr Data"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "11"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "108"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr Data"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float %"
> Print #1, "18"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "5"
> Print #1, "12"
> Print #1, "N"
> Print #1, "N"
> Print #1, "5"
> Print #1, "5"
> Print #1, "0"
> Print #1, "119"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float %"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Q Prio"
> Print #1, "2"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "2"
> Print #1, "13"
> Print #1, "N"
> Print #1, "N"
> Print #1, "2"
> Print #1, "5"
> Print #1, "2"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Q Prio"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "3"
> Print #1, "14"
> Print #1, "N"
> Print #1, "N"
> Print #1, "3"
> Print #1, "5"
> Print #1, "2"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Rpt"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "7"
> Print #1, "1"
> Print #1, "N"
> Print #1, "N"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Rpt"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Date"
> Print #1, "8"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "D"
> Print #1, "0"
> Print #1, "12"
> Print #1, "2"
> Print #1, "N"
> Print #1, "N"
> Print #1, "14"
> Print #1, "0"
> Print #1, "0"
> Print #1, "107"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "1"
> Print #1, "1"
> Print #1, "~Level"
> Print #1, "0"
> Print #1, ""
> Print #1, "1"
> Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA
FIRST PREMIER BANK -FD- 01/09/04 PAGE 1
"
> Print #1, "2"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "0"
> Print #1, "2"
> Print #1, "Page Header"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~Level"
> Print #1, "5"
> Print #1, ""
> Print #1, "3"
> Print #1, "5149860001000015 2004/01/09 5.00
5.00 0002 0009 0001 0000 0000 100
"
> Print #1, " QUEUE PRIO FLOAT CYCL
"
> Print #1, " 00 011
"
> Print #1, "12"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "5"
> Print #1, "2"
> Print #1, "Detail"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~PageSetup"
> Print #1, "1"
> Print #1, "256"
> Print #1, "10"
> Print #1, "50"
> Print #1, "50"
> Print #1, "2"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, ""
> Print #1, "~PageSetupExtended"
> Print #1, "1"
> Print #1, "Y"
> Print #1, "~End"
> Close #1
>
> '''PRJ
> Open p & "\CD1291.prj" For Output As #1
> Print #1, "MFWPRJ01"
> Print #1, "[RefreshDDR]"
> Print #1, "[InputFile]"
> Print #1, p & "\CD1291.RPT"
> Print #1, "[ModelFile]"
> Print #1, p & "\CD1291.mod"
> Print #1, "[ViewTable]"
> Print #1, "[SummaryNoChart]"
> Print #1, "[Author]"
> Print #1, "[Description]"
> Print #1, "[ASCII]"
> Print #1, "[End]"
> Close #1
>
> ''' BAT
> Open p & "\CD1291.bat" For Output As #1
> Print #1, "@.echo off"
> Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
> Print #1, "del " & p & "\CD1291.TMP"
> Close #1
> '''Execute
> Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
> Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl
/E")
> Pause (30)
> Loop
> Do Until Dir(p & "\CD1291.TMP") = ""
> DoEvents
> Loop
> Pause (5)
> If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
> Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyzer.exe " & p &
"\CD1291.prj " & p & "\CD1291.ASC")
> Pause (5)
> L1 = 1
> Do Until L1 = L2
> Open p & "\CD1291.ASC" For Random As #1
> L1 = LOF(1)
> Close #1
> Pause (5)
> Open p & "\CD1291.ASC" For Random As #1
> L2 = LOF(1)
> Close #1
> Loop
> Pause (5)
>
> If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
> If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
> If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
> If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
> If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
> If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
>
> End Function
>
>

ActiveX Script Task - Help!

I have a script that is run in Excel or Access that automatically runs the c
ode I have cut/pasted below. I attempted to cut/paste into an activeX task,
but doesn't work. Would anyone be able to convert this to vbscript?
Thank you in advance for your help,
clutch
Attribute VB_Name = "CD-1291"
Option Compare Database
Option Explicit
Public Function CD1291()
On Error GoTo CD1291_Err
Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d A
s String, L1, L2, sd As Date
d = Application.CurrentProject.Path
If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
Y = Year(Now() - 1)
M1 = Month(Now() - 1)
If M1 < 10 Then
M1 = "0" & M1
End If
M2 = Month(Now() - 1)
If M2 < 10 Then
M2 = "0" & M2
End If
D1 = Day(Now() - 1)
If D1 < 10 Then
D1 = "0" & D1
End If
D2 = Day(Now() - 1)
If D2 < 10 Then
D2 = "0" & D2
End If
'MsgBox Y & "-" & M1 & "-" & D1
p = Application.CurrentProject.Path
''' MSL
Open p & "\CD1291.msl" For Output As #1
Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID '" & Y
& M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 & "0" &
Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
Print #1, "CLOSE"
Print #1, "RUN '" & p & "\CD1291.bat'"
Print #1, "EXIT"
Close #1
''' MOD
Open p & "\CD1291.mod" For Output As #1
Print #1, "MFWMOD12"
Print #1, "~Description"
Print #1, "Premier Bankcard, Inc."
Print #1, ""
Print #1, "~Settings"
Print #1, "M/D/Y"
Print #1, "50"
Print #1, "."
Print #1, "0"
Print #1, "1"
Print #1, "1"
Print #1, ","
Print #1, "0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "Y"
Print #1, "~ExtendedSettings"
Print #1, "42"
Print #1, "N"
Print #1, "(Null)"
Print #1, "1"
Print #1, "1"
Print #1, "128128255"
Print #1, "128,32,96"
Print #1, "255,0,255"
Print #1, "160,0,224"
Print #1, "64128128"
Print #1, "255,0,128"
Print #1, "128128128"
Print #1, "85,85,255"
Print #1, "128,0,128"
Print #1, "193,0,193"
Print #1, "255115115"
Print #1, "128,64,255"
Print #1, "0,128,0"
Print #1, "128,64,64"
Print #1, "255,0,0"
Print #1, "255191255"
Print #1, "255255255"
Print #1, "225225225"
Print #1, "151151151"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "12"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "8"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "~TableField"
Print #1, "Acct #"
Print #1, "16"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "16"
Print #1, "3"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Acct #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Pymt Date"
Print #1, "10"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "10"
Print #1, "4"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "5"
Print #1, "0"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Pymt Date"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Payment"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "19"
Print #1, "5"
Print #1, "N"
Print #1, "N"
Print #1, "19"
Print #1, "5"
Print #1, "0"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Payment"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Amount"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "16"
Print #1, "6"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "53"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Amount"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Strat ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "7"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "70"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Strat ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Line"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "8"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "80"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Line"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Actn ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "9"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "86"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Actn ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr #"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "10"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "96"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr Data"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "11"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "108"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr Data"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float %"
Print #1, "18"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "5"
Print #1, "12"
Print #1, "N"
Print #1, "N"
Print #1, "5"
Print #1, "5"
Print #1, "0"
Print #1, "119"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float %"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Q Prio"
Print #1, "2"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "2"
Print #1, "13"
Print #1, "N"
Print #1, "N"
Print #1, "2"
Print #1, "5"
Print #1, "2"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Q Prio"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "3"
Print #1, "14"
Print #1, "N"
Print #1, "N"
Print #1, "3"
Print #1, "5"
Print #1, "2"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Rpt"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "7"
Print #1, "1"
Print #1, "N"
Print #1, "N"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Rpt"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Date"
Print #1, "8"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "D"
Print #1, "0"
Print #1, "12"
Print #1, "2"
Print #1, "N"
Print #1, "N"
Print #1, "14"
Print #1, "0"
Print #1, "0"
Print #1, "107"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Date"
Print #1, "3"
Print #1, "N"
Print #1, "1"
Print #1, "1"
Print #1, "~Level"
Print #1, "0"
Print #1, ""
Print #1, "1"
Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA
FIRST PREMIER BANK -FD- 01/09/04 PAGE 1
"
Print #1, "2"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "0"
Print #1, "2"
Print #1, "Page Header"
Print #1, "N"
Print #1, "N"
Print #1, "~Level"
Print #1, "5"
Print #1, "???????????"
Print #1, "3"
Print #1, "5149860001000015 2004/01/09 5.00 5
.00 0002 0009 0001 0000 0000 100
"
Print #1, " QUEUE PRIO FLOAT CYCL
"
Print #1, " 00 011
"
Print #1, "12"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "5"
Print #1, "2"
Print #1, "Detail"
Print #1, "N"
Print #1, "N"
Print #1, "~PageSetup"
Print #1, "1"
Print #1, "256"
Print #1, "10"
Print #1, "50"
Print #1, "50"
Print #1, "2"
Print #1, "Y"
Print #1, "Y"
Print #1, "Y"
Print #1, ""
Print #1, "~PageSetupExtended"
Print #1, "1"
Print #1, "Y"
Print #1, "~End"
Close #1
'''PRJ
Open p & "\CD1291.prj" For Output As #1
Print #1, "MFWPRJ01"
Print #1, "[RefreshDDR]"
Print #1, "[InputFile]"
Print #1, p & "\CD1291.RPT"
Print #1, "[ModelFile]"
Print #1, p & "\CD1291.mod"
Print #1, "[ViewTable]"
Print #1, "[SummaryNoChart]"
Print #1, "[Author]"
Print #1, "[Description]"
Print #1, "[ASCII]"
Print #1, "[End]"
Close #1
''' BAT
Open p & "\CD1291.bat" For Output As #1
Print #1, "@.echo off"
Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
Print #1, "del " & p & "\CD1291.TMP"
Close #1
'''Execute
Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl /E")
Pause (30)
Loop
Do Until Dir(p & "\CD1291.TMP") = ""
DoEvents
Loop
Pause (5)
If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyz
er.exe " & p & "\
CD1291.prj " & p & "\CD1291.ASC")
Pause (5)
L1 = 1
Do Until L1 = L2
Open p & "\CD1291.ASC" For Random As #1
L1 = LOF(1)
Close #1
Pause (5)
Open p & "\CD1291.ASC" For Random As #1
L2 = LOF(1)
Close #1
Loop
Pause (5)
If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
End FunctionYou are going to have some very hard work cut out for you here. There is no
application class in VBScripting. There is no DIR() function. There is no
Kill function. You may want to transfer code to VB.net and then have DTS run
an application.
Andrew C. Madsen
Information Architect
Harley-Davidson Motor Company
"clutch" <clutch@.discussions.microsoft.com> wrote in message
news:974122A0-6D23-4C82-BA82-2FCBAF8D2716@.microsoft.com...
> I have a script that is run in Excel or Access that automatically runs the
code I have cut/pasted below. I attempted to cut/paste into an activeX task,
but doesn't work. Would anyone be able to convert this to vbscript?
> Thank you in advance for your help,
> clutch
> Attribute VB_Name = "CD-1291"
> Option Compare Database
> Option Explicit
> Public Function CD1291()
> On Error GoTo CD1291_Err
> Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d
As String, L1, L2, sd As Date
>
> d = Application.CurrentProject.Path
> If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
> If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
> If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
> If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
> If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
> If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
> Y = Year(Now() - 1)
> M1 = Month(Now() - 1)
> If M1 < 10 Then
> M1 = "0" & M1
> End If
> M2 = Month(Now() - 1)
> If M2 < 10 Then
> M2 = "0" & M2
> End If
> D1 = Day(Now() - 1)
> If D1 < 10 Then
> D1 = "0" & D1
> End If
> D2 = Day(Now() - 1)
> If D2 < 10 Then
> D2 = "0" & D2
> End If
> 'MsgBox Y & "-" & M1 & "-" & D1
> p = Application.CurrentProject.Path
> ''' MSL
> Open p & "\CD1291.msl" For Output As #1
> Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID
'" & Y & M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 &
"0" & Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
> Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
> Print #1, "CLOSE"
> Print #1, "RUN '" & p & "\CD1291.bat'"
> Print #1, "EXIT"
> Close #1
> ''' MOD
> Open p & "\CD1291.mod" For Output As #1
> Print #1, "MFWMOD12"
> Print #1, "~Description"
> Print #1, "Premier Bankcard, Inc."
> Print #1, ""
> Print #1, "~Settings"
> Print #1, "M/D/Y"
> Print #1, "50"
> Print #1, "."
> Print #1, "0"
> Print #1, "1"
> Print #1, "1"
> Print #1, ","
> Print #1, "0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "Y"
> Print #1, "~ExtendedSettings"
> Print #1, "42"
> Print #1, "N"
> Print #1, "(Null)"
> Print #1, "1"
> Print #1, "1"
> Print #1, "128128255"
> Print #1, "128,32,96"
> Print #1, "255,0,255"
> Print #1, "160,0,224"
> Print #1, "64128128"
> Print #1, "255,0,128"
> Print #1, "128128128"
> Print #1, "85,85,255"
> Print #1, "128,0,128"
> Print #1, "193,0,193"
> Print #1, "255115115"
> Print #1, "128,64,255"
> Print #1, "0,128,0"
> Print #1, "128,64,64"
> Print #1, "255,0,0"
> Print #1, "255191255"
> Print #1, "255255255"
> Print #1, "225225225"
> Print #1, "151151151"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "12"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "8"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "~TableField"
> Print #1, "Acct #"
> Print #1, "16"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "16"
> Print #1, "3"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Acct #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Pymt Date"
> Print #1, "10"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "10"
> Print #1, "4"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "5"
> Print #1, "0"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Pymt Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Payment"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "19"
> Print #1, "5"
> Print #1, "N"
> Print #1, "N"
> Print #1, "19"
> Print #1, "5"
> Print #1, "0"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Payment"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Amount"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "16"
> Print #1, "6"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "53"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Amount"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Strat ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "7"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "70"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Strat ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Line"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "8"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "80"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Line"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Actn ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "9"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "86"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Actn ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr #"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "10"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "96"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr Data"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "11"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "108"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr Data"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float %"
> Print #1, "18"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "5"
> Print #1, "12"
> Print #1, "N"
> Print #1, "N"
> Print #1, "5"
> Print #1, "5"
> Print #1, "0"
> Print #1, "119"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float %"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Q Prio"
> Print #1, "2"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "2"
> Print #1, "13"
> Print #1, "N"
> Print #1, "N"
> Print #1, "2"
> Print #1, "5"
> Print #1, "2"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Q Prio"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "3"
> Print #1, "14"
> Print #1, "N"
> Print #1, "N"
> Print #1, "3"
> Print #1, "5"
> Print #1, "2"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Rpt"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "7"
> Print #1, "1"
> Print #1, "N"
> Print #1, "N"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Rpt"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Date"
> Print #1, "8"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "D"
> Print #1, "0"
> Print #1, "12"
> Print #1, "2"
> Print #1, "N"
> Print #1, "N"
> Print #1, "14"
> Print #1, "0"
> Print #1, "0"
> Print #1, "107"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "1"
> Print #1, "1"
> Print #1, "~Level"
> Print #1, "0"
> Print #1, ""
> Print #1, "1"
> Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA
FIRST PREMIER BANK -FD- 01/09/04 PAGE 1
"
> Print #1, "2"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "0"
> Print #1, "2"
> Print #1, "Page Header"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~Level"
> Print #1, "5"
> Print #1, ""
> Print #1, "3"
> Print #1, "5149860001000015 2004/01/09 5.00
5.00 0002 0009 0001 0000 0000 100
"
> Print #1, " QUEUE PRIO FLOAT CYCL
"
> Print #1, " 00 011
"
> Print #1, "12"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "5"
> Print #1, "2"
> Print #1, "Detail"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~PageSetup"
> Print #1, "1"
> Print #1, "256"
> Print #1, "10"
> Print #1, "50"
> Print #1, "50"
> Print #1, "2"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, ""
> Print #1, "~PageSetupExtended"
> Print #1, "1"
> Print #1, "Y"
> Print #1, "~End"
> Close #1
>
> '''PRJ
> Open p & "\CD1291.prj" For Output As #1
> Print #1, "MFWPRJ01"
> Print #1, "[RefreshDDR]"
> Print #1, "[InputFile]"
> Print #1, p & "\CD1291.RPT"
> Print #1, "[ModelFile]"
> Print #1, p & "\CD1291.mod"
> Print #1, "[ViewTable]"
> Print #1, "[SummaryNoChart]"
> Print #1, "[Author]"
> Print #1, "[Description]"
> Print #1, "[ASCII]"
> Print #1, "[End]"
> Close #1
>
> ''' BAT
> Open p & "\CD1291.bat" For Output As #1
> Print #1, "@.echo off"
> Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
> Print #1, "del " & p & "\CD1291.TMP"
> Close #1
> '''Execute
> Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
> Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl
/E")
> Pause (30)
> Loop
> Do Until Dir(p & "\CD1291.TMP") = ""
> DoEvents
> Loop
> Pause (5)
> If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
> Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyz
er.exe " & p &
"\CD1291.prj " & p & "\CD1291.ASC")
> Pause (5)
> L1 = 1
> Do Until L1 = L2
> Open p & "\CD1291.ASC" For Random As #1
> L1 = LOF(1)
> Close #1
> Pause (5)
> Open p & "\CD1291.ASC" For Random As #1
> L2 = LOF(1)
> Close #1
> Loop
> Pause (5)
>
> If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
> If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
> If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
> If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
> If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
> If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
>
> End Function
>
>

Activex script - DTSGlobalVariables.Parent - error

Hi,

I migratedDTS From sql server 2000 to 2005 .

But i have problemes with the ativex :

Error: 0xC0048006 at Loop action, ActiveX Script Task: Retrieving the file name for a component failed with error code 0x000F5544.

In DTS ActiveX scripting it was common to get a reference to the package itself using the following line of code:

Dim package = DTSGlobalVariables.Parent

This was used to navigate over the DTS object model , to loop.

Someone can help me to know haw I can do the same thing with the SSIS.

Regards,

chaf wrote:

Hi,

I migrated DTS From sql server 2000 to 2005 .

But i have problemes with the ativex :

Error: 0xC0048006 at Loop action, ActiveX Script Task: Retrieving the file name for a component failed with error code 0x000F5544.

In DTS ActiveX scripting it was common to get a reference to the package itself using the following line of code:

Dim package = DTSGlobalVariables.Parent

This was used to navigate over the DTS object model , to loop.

Someone can help me to know haw I can do the same thing with the SSIS.

Regards,

You should take a look at these links. They will help you:

Get a reference, within a script, to the package using DTSGlobalVariables.Parent
(http://blogs.conchango.com/jamiethomson/archive/2006/07/26/4278.aspx)

Modifing a Package in script
(http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx)

-Jamie

ActiveX ActivePerl DTS Task

I need help with executing an ActiveX Perl DTS Task.

I have ActivePerl installed and I do not get a task error when I run it. The script works perfectly when I run it from a command prompt. The problem is that the task will not extract the files from the tar file.

sub Main()
{
#using modules
use Archive::Tar;
use Compress::Zlib;

#create a new tar archive object
my $tar = Archive::Tar->new;

#set the name of the compressed files
$main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp. tar";

#read the main tar file and extract files
$tar->read($main_tar,1);
$tar->extract();

return 0; # DTSTaskExecResult_Success;
}

Any clue?I think I know why it appears that it wasn't working. It worked but not like I expected. It extracted the files into the default sql server directory.

So My next question is how do specify the directory to extract to?

Originally posted by jcochran2003
I need help with executing an ActiveX Perl DTS Task.

I have ActivePerl installed and I do not get a task error when I run it. The script works perfectly when I run it from a command prompt. The problem is that the task will not extract the files from the tar file.

sub Main()
{
#using modules
use Archive::Tar;
use Compress::Zlib;

#create a new tar archive object
my $tar = Archive::Tar->new;

#set the name of the compressed files
$main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp. tar";

#read the main tar file and extract files
$tar->read($main_tar,1);
$tar->extract();

return 0; # DTSTaskExecResult_Success;
}

Any clue?|||This is really a perl question but I would try setting the directory by using the SetCwd(directory) command.|||Thanks I will try that.|||I keep getting a "Function not found" error. Can anybody give me a peice of sample code using Win32::SetCwd()?|||Here is the updated perl script.

#using modules
use Archive::Tar;
use Compress::Zlib;
use Win32::File;

sub Main()
{
#create a new tar archive object
my $tar = Archive::Tar->new;

#set the name of the compressed files
$main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp. tar";
$res_tar = "ListingsRESIDENTIAL-Residential.txt.gz";

# set the directory
$dir = "C:\Inetpub\wwwroot\legacyrealestate\db\";
Win32::SetCwd($dir);

#read the main tar file and extract files
$tar->read($main_tar,1);
$tar->extract();

return 0; # DTSTaskExecResult_Success;
}

Tuesday, March 20, 2012

active x script task error

Hi,

I am working with an active x script task and I keep getting this error.

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x01DF3DD4.

I have tried to delete all but the first couple of lines but I keep getting this error. Does anyone have any ideas on how I can fix this. This code worked fine in SQL Server 2000.

Thanks

Brian

This is a snippet of my code

Function Main()
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004

set mySourceConn = CreateObject("ADODB.Connection")
set rstemp = CreateObject("ADODB.Recordset")
set newtbltemp = CreateObject("ADODB.Recordset")

Main = DTSTaskExecResult_Success
End Function

I tried your script without any modification. It works.

active x script task error

Hi,

I am working with an active x script task and I keep getting this error.

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x01DF3DD4.

I have tried to delete all but the first couple of lines but I keep getting this error. Does anyone have any ideas on how I can fix this. This code worked fine in SQL Server 2000.

Thanks

Brian

This is a snippet of my code

Function Main()
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004

set mySourceConn = CreateObject("ADODB.Connection")
set rstemp = CreateObject("ADODB.Recordset")
set newtbltemp = CreateObject("ADODB.Recordset")

Main = DTSTaskExecResult_Success
End Function

I tried your script without any modification. It works.sql

ACTIVE X SCRIPT ERROR

I have the following code in an ActiveX Script task for SSIS 2005 package... This worked about a year ago when it was first developed. I am coming in to try to update some things and i am running into this problem

Function Main()

Dim crDocument

Dim crApp

Dim sCRConnectionString

Dim crTable

strServer = DTSGlobalVariables("DBServer")

strDatabase = DTSGlobalVariables("DBName")

strCR = DTSGlobalVariables("CrystalReportPath")

strOutput = DTSGlobalVariables("OutputPath")

sFileOutputPDF = strOutput & "EventLogReport.pdf"

strReportLocation = strCR & "LoggedEvents.rpt"

Set crApp = CreateObject("CrystalRuntime.Application")

Set crDocument = crApp.OpenReport(strReportLocation )

sCRConnectionString = "Provider=SQLOLEDB;server=" & strServer & ";database=" & strDatabase & ";Integrated Security=True"

crDocument.DisplayProgressDialog = False

crDocument.ExportOptions.DestinationType = 1

crDocument.ExportOptions.DiskFileName = sFileOutputPDF

crDocument.ExportOptions.FormatType = 31

MSGBOX("EXPORTING..")

crDocument.Export(False)

MSGBOX("EXPORTING FINISHED!!")

Main = DTSTaskExecResult_Success

End Function

It makes it to the "Exporting.." msg box and then i get the following error

Error: 0xC0048006 at ActiveX Script Task, ActiveX Script Task: Retrieving the file name for a component failed with error code 0x0173DA5C.

At first I thought it may have been an issue with the crystal report having a popup or something come up while this was executing.. but I was able to open the crystal and export the data to a pdf no problem... Any suggestions?

Thanks in Advance!!!

Just an FYI - and not what you want to hear likely, but you should spend your time to convert this to an SSIS Script Task, written in VB.Net. ActiveX is a depricated feature of SSIS.

http://technet.microsoft.com/en-us/library/ms137525.aspx|||

how do i convert

Dim crDocument

Dim crApp

Set crApp = CreateObject("CrystalRuntime.Application")

Set crDocument = crApp.OpenReport(strReportLocation )

into VB.Net for the SSIS Script task... do i also need to import anything? when i right clicked references in the project explore window of the script task editor, i did not see any references that related to crystal?

Thanks in advance

Active Script OK But Scheduled Job Fails

I have an ActiveX Script task in a DTS package which executes fine
within DTS.
However, if I run it as a sheduled job, it fails with a 'path not
found error'. I've cut the code down to the approriate problem and
posted it here, it just makes a simple text file with a name derived
from the current date and time and puts 'Hello World' in the file
although in reality I go on to make an xml file. (make sure your path
exists before you execute it). Why does the scheduled job not execute
this simple task. I have loads of other jobs that run packages to a
schedule and the account is a domain account with windows
administrative rights.

'******************************
' Visual Basic ActiveX Script
'**********************

Const strPath="d:\xml"

Private Function GetDateTime()
Dim strNow, stryear, strMonth, strDay, strTime
strNow = Now
stryear = Mid(strnow, 7, 4)
strMonth = Mid(strnow, 4, 2)
strDay = Left(strnow, 2)
strTime = Replace(Mid(strnow, 12, 8), ":", "")

GetDateTime = stryear + strMonth + strDay + strTime
End Function

Function Main()
Dim fso,f,MyFile 'file objects
Set fso = CreateObject("Scripting.FileSystemObject")
dim strRightNow
strRightNow=GetDateTime()
Set MyFile= fso.CreateTextFile(strPath &"\" & "UPD-"
& strRightNow & ".txt", True) 'This line fails from a scheduled job
MyFile.WriteLine("Hello World")
MyFile.Close
Main = DTSTaskExecResult_Success
End Function

'Error Source= Microsoft VBScript runtime error Error Description:
Path not found Error on Line 25"TiredOfSpam" <spam@.drmcl.free-online.co.uk> wrote in message
news:403767a1.0410080148.b529ff@.posting.google.com ...
>I have an ActiveX Script task in a DTS package which executes fine
> within DTS.
> However, if I run it as a sheduled job, it fails with a 'path not
> found error'. I've cut the code down to the approriate problem and
> posted it here, it just makes a simple text file with a name derived
> from the current date and time and puts 'Hello World' in the file
> although in reality I go on to make an xml file. (make sure your path
> exists before you execute it). Why does the scheduled job not execute
> this simple task. I have loads of other jobs that run packages to a
> schedule and the account is a domain account with windows
> administrative rights.
> '******************************
> ' Visual Basic ActiveX Script
> '**********************
> Const strPath="d:\xml"
> Private Function GetDateTime()
> Dim strNow, stryear, strMonth, strDay, strTime
> strNow = Now
> stryear = Mid(strnow, 7, 4)
> strMonth = Mid(strnow, 4, 2)
> strDay = Left(strnow, 2)
> strTime = Replace(Mid(strnow, 12, 8), ":", "")
> GetDateTime = stryear + strMonth + strDay + strTime
> End Function
> Function Main()
> Dim fso,f,MyFile 'file objects
> Set fso = CreateObject("Scripting.FileSystemObject")
> dim strRightNow
> strRightNow=GetDateTime()
> Set MyFile= fso.CreateTextFile(strPath &"\" & "UPD-"
> & strRightNow & ".txt", True) 'This line fails from a scheduled job
> MyFile.WriteLine("Hello World")
> MyFile.Close
> Main = DTSTaskExecResult_Success
> End Function
> 'Error Source= Microsoft VBScript runtime error Error Description:
> Path not found Error on Line 25

Assuming that D: is a local drive (ie. not mapped to a network share), I can
reproduce your error using the code sample, but I have no idea what the
solution is. Usually, this comes down to a problem of ownership and/or
permissions:

http://support.microsoft.com/?kbid=269074

However, even with both the package and the job owned by the same account (I
tried using both sa and a domain admin account in the sysadmin role), and
with the NTFS permissions of the target folder set to allow Everyone to
create a new file, the scheduled job still failed.

You might want to post this in microsoft.public.sqlserver.dts - you may get
a more useful answer there.

Simon

Thursday, March 8, 2012

Acrord32 - why is it there?

I just looked at my Windows Task Manager and saw a program,
AcroRd32.exe, taking up about 24MBs of memory. This appears to be
something use by Acrobat reader (I think). I did look at a page in IE
that opened up acrobat, but why is it still there?
Is this a problem?
If so, how do I get rid of it?
And how do I keep it from happening again?
Thanks,
Tom.
It is AcreoReader by himself started up as COM-server. And this is not a
subject for this newsgroup I think
"Thomas Scheiderich" <tfs@.deltanet.com> wrote in message
news:40A4A764.6000308@.deltanet.com...
> I just looked at my Windows Task Manager and saw a program,
> AcroRd32.exe, taking up about 24MBs of memory. This appears to be
> something use by Acrobat reader (I think). I did look at a page in IE
> that opened up acrobat, but why is it still there?
> Is this a problem?
> If so, how do I get rid of it?
> And how do I keep it from happening again?
> Thanks,
> Tom.
>

Acrord32 - why is it there?

I just looked at my Windows Task Manager and saw a program,
AcroRd32.exe, taking up about 24MBs of memory. This appears to be
something use by Acrobat reader (I think). I did look at a page in IE
that opened up acrobat, but why is it still there?
Is this a problem?
If so, how do I get rid of it?
And how do I keep it from happening again?
Thanks,
Tom.It is AcreoReader by himself started up as COM-server. And this is not a
subject for this newsgroup I think
"Thomas Scheiderich" <tfs@.deltanet.com> wrote in message
news:40A4A764.6000308@.deltanet.com...
> I just looked at my Windows Task Manager and saw a program,
> AcroRd32.exe, taking up about 24MBs of memory. This appears to be
> something use by Acrobat reader (I think). I did look at a page in IE
> that opened up acrobat, but why is it still there?
> Is this a problem?
> If so, how do I get rid of it?
> And how do I keep it from happening again?
> Thanks,
> Tom.
>

Acrord32 - why is it there?

I just looked at my Windows Task Manager and saw a program,
AcroRd32.exe, taking up about 24MBs of memory. This appears to be
something use by Acrobat reader (I think). I did look at a page in IE
that opened up acrobat, but why is it still there?
Is this a problem?
If so, how do I get rid of it?
And how do I keep it from happening again?
Thanks,
Tom.It is AcreoReader by himself started up as COM-server. And this is not a
subject for this newsgroup I think
"Thomas Scheiderich" <tfs@.deltanet.com> wrote in message
news:40A4A764.6000308@.deltanet.com...
> I just looked at my Windows Task Manager and saw a program,
> AcroRd32.exe, taking up about 24MBs of memory. This appears to be
> something use by Acrobat reader (I think). I did look at a page in IE
> that opened up acrobat, but why is it still there?
> Is this a problem?
> If so, how do I get rid of it?
> And how do I keep it from happening again?
> Thanks,
> Tom.
>

AcquireConnection(txn) ?

In a script task I'm calling AcquireConnection(txn as Object) on a connection manager.

What is the txn parameter supposed to do or be used for?

I'm just passing an empty variable of type Object to this parameter and the method call is working fine...but I'm interested in knowing what its there for.

Thanks
JamieIt is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.|||

DarrenSQLIS wrote:

It is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.

Cool, that makes sense. I figured it was something I didn't have to worry about.

cheers Darren.

-Jamie|||Darren:
A follow-up on this: Ive been writitng a custom dataflow source that analyzes flatfiles by various properties (filesize, width etc.). The component works well when i have a stable flatfile connection. But when i do a for-each file in folder enumeration i cant get the updated connection information (ie filepath) from my component, it will always run against the first path passed by the connection manager. Any ideas on this?|||I've had issues with class level variables and loops since the class is only created once, that was a task though. Simple answer is I don't know, and don't have a suitable component to test with easily, but if you debug the component it should be very simple to work out what is going on. Put a break point on AcquireConnections for a start and see how many times it is called.

Another obvious test would be to add a script component, and make that consume the same connection, and just MsgBox out the connection string.

What do you get?|||

I have an SSIS package with its TransactionOption set to 'Required'. A data flow in the package has a script component that performs updates to a database table. The TransactionOption on the data flow is set to 'Supported'. However the script component does no get enlisted to the transaction because the updates made in the script component do not get rolled back when the package fails.

I'm thinking that I need to pass this 'transaction handle' to the AquireConnection method of the connection used by the script in order for the script to become part of the overall transaction.

In regard to your reply about transaction context. How do I determine it? I have no idea what value I should be passing. I am new to Sql Server beginning with Sql Server 2005. I have no background with DTC.

Thanks.

|||Please, one post will suffice. I have replied, and maybe even answered, in your new thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1322436&SiteID=1

AcquireConnection(txn) ?

In a script task I'm calling AcquireConnection(txn as Object) on a connection manager.

What is the txn parameter supposed to do or be used for?

I'm just passing an empty variable of type Object to this parameter and the method call is working fine...but I'm interested in knowing what its there for.

Thanks
JamieIt is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.|||

DarrenSQLIS wrote:

It is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.

Cool, that makes sense. I figured it was something I didn't have to worry about.

cheers Darren.

-Jamie|||Darren:
A follow-up on this: Ive been writitng a custom dataflow source that analyzes flatfiles by various properties (filesize, width etc.). The component works well when i have a stable flatfile connection. But when i do a for-each file in folder enumeration i cant get the updated connection information (ie filepath) from my component, it will always run against the first path passed by the connection manager. Any ideas on this?
|||I've had issues with class level variables and loops since the class is only created once, that was a task though. Simple answer is I don't know, and don't have a suitable component to test with easily, but if you debug the component it should be very simple to work out what is going on. Put a break point on AcquireConnections for a start and see how many times it is called.

Another obvious test would be to add a script component, and make that consume the same connection, and just MsgBox out the connection string.

What do you get?|||

I have an SSIS package with its TransactionOption set to 'Required'. A data flow in the package has a script component that performs updates to a database table. The TransactionOption on the data flow is set to 'Supported'. However the script component does no get enlisted to the transaction because the updates made in the script component do not get rolled back when the package fails.

I'm thinking that I need to pass this 'transaction handle' to the AquireConnection method of the connection used by the script in order for the script to become part of the overall transaction.

In regard to your reply about transaction context. How do I determine it? I have no idea what value I should be passing. I am new to Sql Server beginning with Sql Server 2005. I have no background with DTC.

Thanks.

|||Please, one post will suffice. I have replied, and maybe even answered, in your new thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1322436&SiteID=1

Friday, February 24, 2012

Accessing Variables in SSIS code

Hi

I am not able to access SSIS variables which are defined at Data Flow Task in a custom component. This custom component is developed by me in C#. How can i access these variables?

Please let me know if theres a way to access SSIS variables.

Thanks,

Vipul

To access the variables in code u need to use the Dispenser class given in Dts

Ex.

Dim vars As Variables
Dts.VariableDispenser.LockOneForRead("<SSISVariable name>", vars)
then use the value like this

vars("<SSISVariable name>").Value

if you want to modify the variable then lock the variable for Write like this


Dts.VariableDispenser.LockOneForWrite("<SSISVariable name>", vars)

Cheers

Atul

|||Custom data flow components, also known as pipeline components, inherit from the PipelineComponent class. This exposes a public read-only property called VariableDispenser, so you can access this in your own methiods, or those you override from the base class, PipelineComponent. This gives you access to the variable dispenser to read or write variables as you desire.|||

Hi Atul

Thanks for the reply.

After making use of VaribleDispenser i am able to get System variables. But when i am trying to access User variables, i m getting this error:

Error: 0xC0047062 at Data Flow Task, i2ADI [91672]: Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: Failed to lock variable "User::sourceId" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

> System.Runtime.InteropServices.COMException (0xC0010001): Failed to lock variable "User::sourceId" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

The only difference which i could figure out was that System vars are defined at Package level scope, while the user variables are defined at Data Task Flow level. Can this be the issue? Please let me know if you have some other pointers..

Thanks,

Vipul

|||

Hi Vipul:

A couple of things:

My experience has been that variables are scoped to the object that is selected when you add the variable to the project. If you happened to have a Data Task selected when you add a variable, it's scope will be that Data Task. You can most definately create variables that are scoped to the entire package -- just make sure to click anywhere on the white surface in the Control Flow outside of any task object (this action should de-select any selected object) before adding a variable.

You can verify a variable's scope in the Variables dialog. The Scope column contains either "Package" or the name of a task object (if the variable is scoped to a single object).

You can scope variables to a container, such as a ForEach Loop or Sequence Container. Then, all the tasks within the container "see" the variable.

Variable names are case-sensitive. In your example, you refer to "User::sourceId" -- you must have a variable named "sourceId", and not "SourceID" or any of a zillion different ways to case the name.

The code suggested by Atul should work for you.

I always use the "ReadVariable" and "WriteVariable" functions presented by Daniel Read in his excellent article:

http://www.developerdotstar.com/community/node/512

Just some thoughts.

|||

Hi Mike:

Thanks for the reply. This is the my part of code which i m using.

Microsoft.SqlServer.Dts.Runtime.Package pkg;

Variables sourceIdVar = null;

Microsoft.SqlServer.Dts.Runtime.VariableDispenser vd;

pkg = new Microsoft.SqlServer.Dts.Runtime.Package();

vd = pkg.VariableDispenser;

vd.LockForRead("System::PackageName");

vd.LockForRead("User::sourceId"); // <- accessing this variable is throwing exception

vd.GetVariables(ref sourceIdVar);

foreach (Microsoft.SqlServer.Dts.Runtime.Variable myVar in sourceIdVar)

{

Console.WriteLine("Name : " + myVar.Name);

Console.WriteLine("Description : " + myVar.Description);

}

Let me know your views on this part of code.

Thanks,

Vipul

|||

Hi Mike:

I was able to solve it. Code correction:

IDTSVariables90 variables = null;

this.VariableDispenser.LockForRead("User::dimSrcId");

this.VariableDispenser.GetVariables(out variables);

dimSrcId = variables["User::dimSrcId"].Value.ToString();

variables.Unlock();

Thanks for your help.

Vipul

|||

Hello

if i need to show all system variable in me Custom component what should i do

the code :

Dim Var As IDTSVariables90 = Nothing

Me.VariableDispenser.LockForWrite("System::StartTime")

Me.VariableDispenser.GetVariables(Var)

Var.Unlock()

Accessing Variables in SSIS code

Hi

I am not able to access SSIS variables which are defined at Data Flow Task in a custom component. This custom component is developed by me in C#. How can i access these variables?

Please let me know if theres a way to access SSIS variables.

Thanks,

Vipul

To access the variables in code u need to use the Dispenser class given in Dts

Ex.

Dim vars As Variables
Dts.VariableDispenser.LockOneForRead("<SSISVariable name>", vars)
then use the value like this

vars("<SSISVariable name>").Value

if you want to modify the variable then lock the variable for Write like this


Dts.VariableDispenser.LockOneForWrite("<SSISVariable name>", vars)

Cheers

Atul

|||Custom data flow components, also known as pipeline components, inherit from the PipelineComponent class. This exposes a public read-only property called VariableDispenser, so you can access this in your own methiods, or those you override from the base class, PipelineComponent. This gives you access to the variable dispenser to read or write variables as you desire.|||

Hi Atul

Thanks for the reply.

After making use of VaribleDispenser i am able to get System variables. But when i am trying to access User variables, i m getting this error:

Error: 0xC0047062 at Data Flow Task, i2ADI [91672]: Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: Failed to lock variable "User::sourceId" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

> System.Runtime.InteropServices.COMException (0xC0010001): Failed to lock variable "User::sourceId" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

The only difference which i could figure out was that System vars are defined at Package level scope, while the user variables are defined at Data Task Flow level. Can this be the issue? Please let me know if you have some other pointers..

Thanks,

Vipul

|||

Hi Vipul:

A couple of things:

My experience has been that variables are scoped to the object that is selected when you add the variable to the project. If you happened to have a Data Task selected when you add a variable, it's scope will be that Data Task. You can most definately create variables that are scoped to the entire package -- just make sure to click anywhere on the white surface in the Control Flow outside of any task object (this action should de-select any selected object) before adding a variable.

You can verify a variable's scope in the Variables dialog. The Scope column contains either "Package" or the name of a task object (if the variable is scoped to a single object).

You can scope variables to a container, such as a ForEach Loop or Sequence Container. Then, all the tasks within the container "see" the variable.

Variable names are case-sensitive. In your example, you refer to "User::sourceId" -- you must have a variable named "sourceId", and not "SourceID" or any of a zillion different ways to case the name.

The code suggested by Atul should work for you.

I always use the "ReadVariable" and "WriteVariable" functions presented by Daniel Read in his excellent article:

http://www.developerdotstar.com/community/node/512

Just some thoughts.

|||

Hi Mike:

Thanks for the reply. This is the my part of code which i m using.

Microsoft.SqlServer.Dts.Runtime.Package pkg;

Variables sourceIdVar = null;

Microsoft.SqlServer.Dts.Runtime.VariableDispenser vd;

pkg = new Microsoft.SqlServer.Dts.Runtime.Package();

vd = pkg.VariableDispenser;

vd.LockForRead("System::PackageName");

vd.LockForRead("User::sourceId"); // <- accessing this variable is throwing exception

vd.GetVariables(ref sourceIdVar);

foreach (Microsoft.SqlServer.Dts.Runtime.Variable myVar in sourceIdVar)

{

Console.WriteLine("Name : " + myVar.Name);

Console.WriteLine("Description : " + myVar.Description);

}

Let me know your views on this part of code.

Thanks,

Vipul

|||

Hi Mike:

I was able to solve it. Code correction:

IDTSVariables90 variables = null;

this.VariableDispenser.LockForRead("User::dimSrcId");

this.VariableDispenser.GetVariables(out variables);

dimSrcId = variables["User::dimSrcId"].Value.ToString();

variables.Unlock();

Thanks for your help.

Vipul

|||

Hello

if i need to show all system variable in me Custom component what should i do

the code :

Dim Var As IDTSVariables90 = Nothing

Me.VariableDispenser.LockForWrite("System::StartTime")

Me.VariableDispenser.GetVariables(Var)

Var.Unlock()