Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2006, 10:15 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default type mismatch error in VB Script

Hi --

I'm getting "type mismatch: 'objFSO.Copyfile' in the following VBScript. Any ideas why I can't copy the output from an SQL task in a DTS package? Thanks in advance.

Function Main()

dim objFSO
dim sSourceFile
dim sOutputFile

set objFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile = DTSGlobalVariables("dexResults").Value
sOutputFile = "C:\dexresult.txt"

objFSO.CopyFile sSourceFile, sOutputFile

Main = DTSTaskExecResult_Success
Set ojbFSO = Nothing

End Function
 
Old February 20th, 2006, 07:05 AM
Authorized User
 
Join Date: Oct 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Worked for me.

I dont know what you are comying but I copied a simple file from one place to another without problem.
 
Old February 20th, 2006, 12:13 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'll bet that it is a problem with your global variable dexResults. Global variable names are case sensitive. I am guessing that your global variable dexResults is not initialized. Either there is no dexResults global variable defined, it does not have a value or it is defined but as DexResults (maybe you have two variables defined).

To debug you can do one of two things, when running it manually you can use MsgBox DTSGlobalVariables("dexResults").Value

Or you can use DTSPackageLog.WriteStringToLog "dexResults is :" & DTSGlobalVariables("dexResults").Value
For more information on using WriteStringToLog see
http://www.mutuallybeneficial.com/in...s_portable.htm
For some examples on using Write string look at DTS ActiveX Logging Script.txt on that page.


David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error-0x800A000D-Type mismatch kishy449 Classic ASP Basics 0 July 23rd, 2007 04:48 AM
Type Mismatch error Sheraz Khan Classic ASP Basics 0 May 16th, 2007 08:12 AM
byref Argument type mismatch in vb Vijay_VB VB How-To 1 August 16th, 2004 08:53 AM
Data Type Mismatch error transcona Classic ASP Databases 4 June 25th, 2003 07:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.