ActiveX Script Task/Function Not Found
Jul 3, 2006
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?
View 3 Replies
ADVERTISEMENT
Mar 10, 2008
I'm trying to create new SSIS package and i'm using one of the control flow Item is "ActiveX Script Task". Following is script.
When i execute the task it errors out that "Function not Found". do i need to create this Function first? I'm new to SQL 2005. so any suggestion will be appreciated.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim srccsvfile
Dim objExcel
Dim objWorkbook, objWorksheet
srccsvfile = "\pc17917c$Documents and Settingskdesai1DesktopCRM Daily Supervisor Report.xls"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.displayalerts = False
Set objWorkbook = objExcel.Workbooks.open(srccsvfile)
Set objWorksheet = objWorkbook.WorkSheets("DailyAllCases")
objWorksheet.Activate
objWorksheet.Delete 'this is removing the worksheet instead of rows
objWorkbook.Save 'you must save the change otherwise in trouble
objExcel.Workbooks.Close
Set objWorkbook = Nothing
objExcel.Quit
Set objExcel = Nothing
Main = DTSTaskExecResult_Success
End Function
Please Advice,
KD
View 4 Replies
View Related
Jan 16, 2004
Hi,
Thanks for reading.
I am creating a DTS package to import a .txt file into sql. I have everything in place, but the text file needs to have the last record deleted before the import. I need help with this part
I would like to delete the last record from a fixed width text file before I import it into sql. The number of rows will vary from file to file.
Can any one offer suggestions on the best way to do this.
I understand that I have to use the FSO to open and read the file, but I am not sure the best way to proceed after that.
Thanks in advance,
Steve
View 1 Replies
View Related
Feb 9, 2004
I have no idea what's going on.. but when I open the SQL DTS designer.. there's no ActiveX Script task on the left toolbar anymore. It used to be there. How do I get it back?? I remember playing around with some dts dll files on my machine... maybe I did something that made it go away (note: the DB server is not on my machine.. I just run Enterprise Manager on my machine to access it). Should I reinstall Enterprise Manager?
View 1 Replies
View Related
Apr 3, 2006
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.
View 2 Replies
View Related
Jan 27, 2006
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,
View 2 Replies
View Related
May 12, 2006
I'm having a bear of a time with this. I have a recordset that pulls data from one, single table. I would like to iterate through the set, do some processing based on that data, then delete all of the records in that recordset.
I'm trying to do something like the following:
Set dbConn = CreateObject("ADODB.Connection")
Set dbRS = CreateObject("ADODB.Recordset")
dbConn.Open("myConnectString")
dbRS.open dbSQLCmdText, dbConn, 2, 4
While Not dbRS.EOF
Do some stuff
dbRS.Delete
Wend
dbRS.BatchUpdate
dbRS.Close
dbConn.Close
I get an error stating:
"Multiple-Step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
This seems to indicate the connection doesn't think it's capable of reconciling the recordset. Is there a way to do this in one batch or should I stick with executing a single delete statement for every record in my recordset?
View 2 Replies
View Related
Jun 6, 2006
I'm attempting to call a storedprocedure from within an ActiveX task ina DTS and am getting a "Command Text was not set for the commandobject" error. I have no problem if I replace the stored procedure callwith the actual SQL.Is it possible to directly call a SP via an ActiveX task? If yes, couldsomebody help me with the syntax please?This is what I have currently haveSet Conn = CreateObject("ADODB.Connection")SQL = "exec (MySP)"set RLoop=conn.Execute(SQL)do while (NOT RLoop.EOF)msgbox RLoop(1)RLoop.MoveNextLoopTIAKarthik
View 1 Replies
View Related
Aug 23, 2007
Using ActiveX Script Task it is possible create office automation objects such as Word and Excel typically using the CreateObject() Syntax. Can you use this syntax to create a Package object using CreateObject("DTS.Package")? If not Why not? I am not sure whether it was possible in DTS.
I am aware of the fact that ActuveX Script Task is included in this Version of SSIS and will be deprecated.
View 2 Replies
View Related
Jul 6, 2001
Hi,
I've written a DTS Package to pull information from a number of servers. I have a list of servers (Source Servers) and for each one I automatically update the Datasource property of the Source Server connection using vbscript in an ActiveX Script task and a global variable.
I have a transformation that occurs between the Source server and Target server.
As I process each Source Server in turn, the global variable gets set correctly and so does the Datasource property of the Source Server connection. However the transformation still runs against the first Source Server that was processed.
Looking at BOL it appears that a transformation stays connected even after it has finished. Therefore I assume that although I change the Datasource of the connection to a new server, it still runs against the first server that was used.
My question is how do I get the connection to run against the updated Datasource, i.e. do I need to do a refresh of the Connection, disconnect or what ?
Any ideas would be much appreciated.
thanks
View 2 Replies
View Related
Sep 13, 2006
I have a DTS package that I brought over from SQL server 2000 in to SQL Server 2005. I have installed all of the legacy components to run the DTS packages but I need to debug an ActiveX script task. In SQL Server 2000 I could turn on Just-In-Time debugging and use the stop operator (in my vbscript) to break the running script and launch the debugger.
I don't see how to do this in SQL Server 2005 Management Studio. Is it possible to debug a script object in a DTS package running in SQL Server 2005?
Jay Abbott
View 1 Replies
View Related
Oct 27, 2006
I need to retrieve the Global Variables set in my package configuration file within an ActiveX Script Task within an SSIS package. In DTS, I could access the Global Variables to execute a SQLXMLBulkLoad for the following statement:
==========================================
Function Main()
Response.Expires=-1
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString =
"provider=SQLOLEDB.1;server=ABC123;database=MyDB;Trusted_Connection=Yes;"
objBL.KeepIdentity = False
objBL.CheckConstraints = False
objBL.Execute DTSGlobalVariables("gv_XSDSchemaFile").Value, DTSGlobalVariables("gv_XMLFullPath").Value
Main = DTSTaskExecResult_Success
set objBL=Nothing
End Function
=========================================
I have tried using the Script Task to write this in VB.NET, however the MSXML4.0 is not exposed within the limited object model of the Script Task Designer. I have written a Data Flow Object using the XML Source, however it requires quite a bit of effort to have the Data Flow Component parse the XML (with 10 hierarchical nodes), transform each and provide a SQL Server Destination. This works, however the XML Source Component requires a hardcoded reference to the XSD Schema file and does not allow for a Global Variable to used. (They do provide this functionality for the XML file source though).
My requirement is to allow for the Global Variable to be passed for the Schema file at runtime. The only way I can think of is to recreate what I was doing in DTS where I could simply pull in the XML and XSD Global Variables and execute the SQLXMLBulkLoad in VB Script.
Any ideas on how to write this in VBScript within the ActiveX Script Task in SSIS?...
Michael
View 1 Replies
View Related
Apr 14, 2008
Hello,
I'm working on a function that will return the results in a SELECT statement. But it's not being called properly, and I can't understand why it isn't working. If anyone can help me out I'd greatly appreciate it.
Here's the function code:1 FUNCTION [dbo].[UDFproduct_Search]2 ( 3 @search_string varchar(255)4 )5 RETURNS TABLE 6 AS7 RETURN 8 (9 SELECT product_id10 FROM product11 WHERE product_item_number LIKE '%' + @search_string + '%' OR12 product_part_number LIKE '%' + @search_string + '%' OR13 product_name LIKE '%' + @search_string + '%' OR14 product_commodity LIKE '%' + @search_string + '%'15 )
This SELECT statement returns the expected value:SELECT * FROM UDFproduct_Search('CABINET')
This SELECT statement returns the expected value:1 SELECT * FROM where_used WHERE product_id 2 IN(SELECT product_id FROM product3 WHERE product_item_number LIKE '%' + 'CABINET' + '%' OR4 product_part_number LIKE '%' + 'CABINET' + '%' OR5 product_name LIKE '%' + 'CABINET' + '%' OR6 product_commodity LIKE '%' + 'CABINET' + '%')
This SELECT statement returns errors:SELECT * FROM where_used WHERE product_id IN(UDFproduct_Search('CABINET') Error:'UDFproduct_Search' is not a recognized built-in function name.
I've tried adding dbo to the function call, and in various locations, but I still get the error. Hope someone can point something out I missed.
Thanks.
View 4 Replies
View Related
Oct 3, 2005
I issue this command in QA:CREATE FUNCTION encrypt_pair (@data VARCHAR(14) , @key char(30) )RETURNS VARCHAR (60) ASBEGINDECLARE @encryptedvars VARCHAR(60)EXEC master..xp_aes_encrypt @data,@key,@encryptedvars OUTPUTRETURN @encryptedvarsENDIf I run it again, I get an error that it already exists (duh).Next I run:select student_id, student_ssn,encrypt_pair(student_ssn,'000000000000000000000000 00000000') fromstudent_ssnand I get the error:Server: Msg 195, Level 15, State 10, Line 1'encrypt_pair' is not a recognized function name.I don't get whats wrong!ThanksRob
View 2 Replies
View Related
Oct 22, 2007
When I try to create an SSIS package with an FTP task, it always fails to compile with the messages:
Error at Package: The connection "" is not found. This error is thrown by Connections collection when the specific connection element is not found.
Error at FTP Task [FTP Task]: Connection manager "" can not be found.
Error at FTP Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
The item is marked with a circled-X. The tool-tip also agrees: The connection "" is not found.
Using my recreation steps below, I am setting up a connection manager, but it is never found at compile time.
1. Open BIDS, select a new Integration Services project.
2. Drag an FTP task from the toolbox to the Control Flow window.
3. Double-click the FTP task.
4. On the FTP Task Editor window, General page, pull down the FTPConnection property.
5. Select <New Connection...>
6. On the FTP Connection Manager Editor window, enter the servername, port, username and password.
7. Click "Test Connection" to verify connectivity. (It succeeds.)
8. Click OK on the FTP Connection Manager Editor window.
9. Click OK on the FTP Task Editor window.
I'm not using a configuration file or logging provider for this example.
I have also installed SP2 + cumulative update 2.
View 2 Replies
View Related
May 23, 2006
Hi,
I have created a FTP task that logs into FTP server and receives files and scheduled it to run every 15min. However, it fails when there are no files on FTP. How would I check the if files exist? How can I catch the FTP task error and compare it to Hresults.NoFilesFound in a script task?
Thanks in advance for any help.
View 7 Replies
View Related
Mar 8, 2000
I have set up replication on two SQL Servers (6.5), SP5a, on NT 4.0 (SP3). The Distribution Task on the Publisher is failing with the following error:
08001[Microsoft][ODBC SQL Server Driver][dbnmpntw]Specified SQL Server not found.
I am using standard security in a workgroup environment. I have my trusted connection setup and I am using named pipes. I had this process working on our test servers but when I tried to implement it into production I received the above message. Please give me some ideas or things to try. What source can I use to look up the 08001 error?
Thanks, Kevin
View 1 Replies
View Related
Aug 20, 2006
I have a package with an XML Task with OperationType = Validate. The source is a string variable and the second operand is a file connection to a schema file. The schema file <include>'s other schemas. I run the package in debug mode in Visual Studio with no errors. I exit Visual Studio. Then I open Visual Studio again and run the package in debug mode like before and it fails in the xml task with error: "Task failed to validate "No schema to use in validation was found.". I don't understand why it fails since no changes were made. The strange thing is that if I click the File Connection Manager for the schema file and click Browse and then reselect the same schema file again then it runs OK. Note that I have to exit Visual Studio and not just close the package in order to repro the error. It seems like exiting Visual Studio frees some resource that is essential to the validation. Reselecting the schema file in the Connection Manager seems to restore the resource. (SP1)
View 2 Replies
View Related
Nov 2, 2015
When my ForEach Loop runs, when a file does not exist on the server, I am getting a File does not exist error.I would prefer to write a mesaage to my log and then move on to the next step successfully.When I got to Event Handlers and select OnTaskFailed, what do I want to do from here?
View 0 Replies
View Related
Jul 28, 2006
This error occurs when the ActiveX task tries to execute:
[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x001B6438.
Anybody know how to troubleshoot these errors? I can't find anything on this error code. The same script works in DTS.
View 8 Replies
View Related
Jul 10, 2015
I have an execute process task set up to run ftp.exe and a script argument. The ftp.exe is referenced in the executable field without a qualified path. The package just seems to know it's there relatively. I need to change this to run a secured ftp executable that I recently installed on my pc. I put the new executable in the WindowsSystem32 folder where the old ftp.exe is stored. But when I put the new executable in the executable field, it says the 'File/Process "FTPS.exe" is not in path'. I get the same error when I fully qualify the path. Is there something I need to do with the new executable for SSIS to pick it up without having to fully qualify the path?
View 8 Replies
View Related
Apr 9, 2008
Hi,
I am using the SMTP Task to send an email to about 200 individuals with their own specific attachment. If it cannot find the attachment the SMTP Task fails.
Is there a way to log the failure and have it keep going? That way it will still process everyone, but I would get a list of those who didn't receive the email because there was a problem.
I looked at Jamie Thompson's blog and he had a great script to send out emails. But if I use that, I haven't yet figured out how to pass the filename variable to it and attach the file. Even if I use that script, how do I deal with the errors?
Thank you for the help.
-Gumbatman
View 6 Replies
View Related
May 30, 2008
Hi All,
I am inserting a row in my SSIS_LOG table when my package executes. Here in this table i have column date_dt which is date data type. Once package executes i am getting error like "No authorized routine named "GETDATE" of type "Function" having compatible arguments was found. sqlstate:42884". Note i am using IBMDB2 data provider.
Can anyone help me out?
Thanks in advance,
Anand Rajagopal
View 9 Replies
View Related
Aug 24, 2006
I have a script task that I've created that just displays a MsgBox as listed in Professional SQL Server 2005 Integration Services in chapter 4. The problem is that when I exit the VSA design tool there is a red "X" on the task that says in a popup:
"The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE..."
I go back into the script design, and the code is there, and the PreCompile propterty IS set to True. Attempting to EXECUTE the task only results in a similar error, just more verbose without actually giving any additional insight.
I've read the thread on where the VSA code is deleted on closing.. but my code is still there.. it just isn't seeing the binary code (if it actually exists).
Ideas, comments or snide remarks anyone?
- Mark
View 10 Replies
View Related
Sep 17, 2007
Hi,
I've a function which I'm using in one of my script task. Then I do some operations and in other script task I'm using same function. If I change a function in one task then I need to do in all other tasks. Is there a way where we can write this function at package level and be able to use in any of the task.
Regards
Munafbhai
View 1 Replies
View Related
Feb 26, 2007
We have a Data Flow Task.
Inside this, we have a OLE DB Data Source which calls and executes a stored procedure.
We use a Row Count Task to count the number of rows returned by the OLE DB Data Dource Task.
Then, we use an aggregate function task to get the sum of all the rows of one particular column that is returned from the OLE DB Data Source.
The issue here is that we want to assign the sum value returned by the Aggregate Function Task to a User Variable named User::Variable. We have tried to assign this by using @User::Variable and User::Variable, but neither of those return the expected value.
If there is any other method to do the same then let us know.
We have checked the that the row count is greater than zero.
Any help would be very much appreciated.
Thanks in advance.
View 4 Replies
View Related
Jul 19, 2007
hi
I am trying to execute a UDF in an Execute SQL Task within a Foreach loop.
I have an Execute SQL task to get the dataset (Firstname, Lastname, CompanyID) which is going into a full result set called @PendingPar. The Foreach Loop is set to a Foreach ADO Enumerator against @PendingPar and I have created 3 variables at the Foreach Loop scope level called @Firstname (String), @Lastname (String) and @CompanyID (Int32). These are mapped in the Foreach Loop as index 0,1 and 2.
Within the Foreach Loop I have an Execute SQL Task with the sql command
select dbo.udf_GetParTitle (?,?,?)
In the parameter mapping I have Variable Name = User::Firstname Direction = Input Data Type = VARCHAR and Parameter Name = 0, User::Lastname, Input, VARCHAR, 1 and User::CompanyID, Input, VARCHAR,2
Finally the UDF returns a @NewPar value so i have the result set in the execute sql task to Single Row which goes into variable @NewPar. This @newPar will be used later but I cannot get the first bit to work yet.
the error message i get back is
Error: 0xC002F210 at Execute SQL Task 1, Execute SQL Task: Executing the query "select dbo.udf_GetParTitle (?,?,?)
" failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Execute SQL Task 1
the initial execute sql task where the dataset is selected works fine but it is within the foreach loop that it fails.
any help gratefully recieved
View 6 Replies
View Related
Sep 7, 2006
I have a field called CustomerName Varchar 100 and I wish to write a function that can do the following in a script component task
create a function called CleanString (ByVal CustomerName as String) As String
CleanString Returns the last word of a Customer name if the CustomerName field contains more than one word or if the CustomerName field does not contain Corp or Ltd
ie parse 'Mr John Tools' and the function returns 'Tools'
ie parse 'TechnicalBooks' and the function returns 'TechnicalBooks'
ie parse 'Microsoft Corp' return 'Microsoft Corp'
ie parse 'Digidesign Ltd' return 'Digidesign Ltd'
Any idea of a regular expression or existing piece of existing code I can have
thanks in advance
dave
View 3 Replies
View Related
May 1, 2007
I've got a package which reads a text file into a table and updates another. I set up configurations so that I could import it into the SSIS store on both my dev and live servers. Now, I'm getting this error. I tried removing the configs and am still getting it.
I've been through each step and everything looks okay. Does anyone have any idea (a) what's wrong, (b) how to localise the error or (c) get any additional information? Or do I just have to recreate the package from scratch?
TITLE: Package Validation Error
------------------------------
Package Validation Error
------------------------------
ADDITIONAL INFORMATION:
Error at PartnerLinkFlatFileImporter: The connection "" is not found. This error is thrown by Connections collection when the specific connection element is not found.
Error at PartnerLinkFlatFileImporter [Log provider "SSIS log provider for SQL Server"]: The connection manager "" is not found. A component failed to find the connection manager in the Connections collection.
(Microsoft.DataTransformationServices.VsIntegration)
------------------------------
BUTTONS:
OK
------------------------------
View 20 Replies
View Related
Jun 21, 2007
OK. I give up and need help. Hopefully it's something minor ...
I have a dataflow which returns email addresses to a recordset.
I pass this recordset into a ForEachLoop configuring the enumerator as (Foreach ADO Enumerator). I also map the email address as a variable with index 0.
I then have a Execute SQL task which receives this email address as a varchar variable (parameter 0) which I then use in my SQL command to limit the rows returned. I have commented out the where clause and returned all rows regardless of email address to try to troubleshoot this problem. In either event, I then use a resultset to store the query result of type object and result name 0.
I then pass this resultset into a script variable to start parsing the sql rows returned as type object. ( I assume this is the correct way to do this from other prior posts ...).
The script appears to throw an exception at the following line. I assume it's because I'm either not passing in the values properly or the query doesn't return anything. However, I am certain the query works as it executes just fine at the command prompt.
Try
ds = CType(Dts.Variables("VP_EMAIL_RESULTS_RS").Value, DataSet)
My intent is to email the query results to each email address with the following type of data by passing the parsed data from the script to a send mail task. Email works fine and sends out messages but the content is empty. I pass the parsed data as string values to the messagesource and define the messagesourcetype as a variable in the mail task.
part number leadtime
x 5
y 9
....
Does anyone have any idea what I might be doing wrong?
thanks
John
View 5 Replies
View Related
Apr 23, 2001
How do I use ActiveX script in DTS to do a 'Save As' on an excel file and
convert that to a tab delimited text file ?
Help is much appreciated.
Hayes
View 2 Replies
View Related
Jan 29, 2004
I have to put some ActiveX code in the first step of a DTS package, which will search thru all the files in some folder and if it finds a file with filename starting with "Test" (like TestFile.txt), the script will rename it and then use it for transforming data to SQL tables.
In VB Dir$ function could have been used, what should I use in ActiveX?
Thanks a lot for your help
View 3 Replies
View Related
Sep 26, 2006
hello friends, i heard from my colleagues that xml and activex are necessary for DBA
is it so? how could we use in our daily activities?
can any one provide me good links for this concepts please?
thank you very much.
View 8 Replies
View Related