Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

USING VBA from an MS Access module in SSIS (Script Task)

 
   Database Help (Home) -> DTS RSS
Next:  Which is faster - MySQL query, or PHP loop  
Author Message
robboll

External


Since: Jan 15, 2008
Posts: 47



(Msg. 1) Posted: Tue Feb 02, 2010 7:06 am
Post subject: USING VBA from an MS Access module in SSIS (Script Task)
Archived from groups: microsoft>public>sqlserver>dts (more info?)

I have an "Execute SQL Task" that has hard coded values like:
SELECT CLSD_FL FROM "AMS_FINUSER"."R_APD"
WHERE FY = '2010' AND PER = '4'

FY = Fiscal Year (Oct-Sep) and PER = Fiscal Month (January)


Both FY and PER can be derived using VBA.


This code works to derive the Fiscal Year and Fiscal Month in an MS
Access module using VBA but
does not work in SSIS:


----------------------------------------------------------- start


Option Compare Database


Option Explicit
Const FMonthStart = 10 ' Numeric value representing the first
month
' of the fiscal year.
Const FDayStart = 1 ' Numeric value representing the first
day of
' the fiscal year.
Const FYearOffset = -1 ' 0 means the fiscal year starts in the
' current calendar year.
' -1 means the fiscal year starts in
the
' previous calendar year.


Function GetFiscalYear(ByVal X As Variant)
If X < DateSerial(Year(X), FMonthStart, FDayStart) Then
GetFiscalYear = Year(X) - FYearOffset - 1
Else
GetFiscalYear = Year(X) - FYearOffset
End If
End Function


Function GetFiscalMonth(ByVal X As Variant)
Dim m
m = Month(X) - FMonthStart + 1
If Day(X) < FDayStart Then m = m - 1
If m < 1 Then m = m + 12
GetFiscalMonth = m
End Function


------------------------------------------------------ End


==============================================================
Here's everything I am trying to accomplish:


There is a maintenance table called r_apd with values like:


FY PER CLSD_FL
2009 11, 1
2009 12 1
2009 13 1
2010 1 1
2010 2 1
2010 3 1
2010 4 0 <-- current
2010 5 0
2010 6 0


Whenever all data is available for that FY/PER, the CLSD_FL (Closed/
Final) value changes to a 1


I am trying to set up the SSIS job so that if FY = '2010' and PER =
'4' and CLSD_FL = '1' it kicks off the job.


So the Execute Task use variables and look something like:


SELECT CLSD_FL FROM "AMS_FINUSER"."R_APD"
WHERE FY = mFY AND PER = mPER;


And if CLSD_FL = 1 it runs the job.


Any help or references on how to use the above VBA in an SSIS package
appriciated!


Thank you!


RBollinger

 >> Stay informed about: USING VBA from an MS Access module in SSIS (Script Task) 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
SSIS: Blank FolderBrowserDialog in VB.NET Script Task - Hello all, Is anyone having problems with the FolderBrowserDialog being blank in a script task? Please see my thread in ms.pub.dotnet.languages.vb for more info:..

Cannot edit SSIS Script Task in SQL Server BIDS 2008 - I have a SSIS package with Script Task created in SQL Server BIDS 2008 . When I open the Script Task Editor and click on the 'Edit Script' button. I get a following error message. I uninstalled and installed again as whole SQL Server 2008 as shared..

how to cast object type to string type in SSIS's Script Task - Hi, Any idea on casting the Object type to String type in ScriptTask's Design Script area. Thank you in advance. Daniel.

how to troublshoot smtp send mail SSIS task - I have a simple SSIS package that runs a sql query that exports to a flat file, then emails this flat file to an address. I built the package in Visual Studio 2005, where the package runs without a problem. I save the package out to a sql 2005 sp2..

EXEC Stored Procedure does not work in SSIS task - Hi, I have a SSIS package In my source "data flow" task I have a stored procedure (sp_GetTrafficData) which gets the data and populates the table in the destination task. The stored procedure sp_GetTrafficData executes another stored procedur...
   Database Help (Home) -> DTS All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]