Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 7th, 2007, 05:29 PM
Authorized User
Join Date: Dec 2006
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default error in .vbs FTP routine invoked from VB 6.0

I’m getting an error when trying to run this VBscript.
Script: (the pathname of the script)
Line: 25
Char: 1
Error: type mismatch: ‘format’
Code: 800a000d
Source: Microsoft vbscript runtime error

I’ve used several .vbs FTP scripts before with no problem, but what’s new/different with this one is that the Upload filename is not static, it’s
L(the current date in mmddyy format)t
for example

This VBscript is being invoked from some VB 6.0 code.
In VB 6.0 , I’ve used statements like:
DestinationFile = "D:\BD\HT\NewBusiness\HT" & Format(Date, "mmddyy") & ".txt"
all the time without problem.

My question is:
What format do I need to make the .Upload statement in the .vbs to get it to work
Or if that’s not what needs to be done
Is there a way to pass via variables from vb 6.0 to vbscript the names of the two files to use in the upload statement, so I pass in the L020707t name + the path needed?

Thanks in advance,

' VBS Script Generated by CuteFTP (TM) macro recorder.
' Generated, then edited: 02/07/07 by dgr

' Create TEConnection object
Set MySite = CreateObject("CuteFTPPro.TEConnection")

' Initialize remote server host name, protocol, port, etc.
MySite.Host = "ftp.letterlogc.com"
MySite.Protocol = "FTP"
MySite.Port = 21
MySite.Retries = 34
MySite.Delay = 7
MySite.MaxConnections = 4
MySite.TransferType = "ASCII"
MySite.DataChannel = "DEFAULT"
MySite.AutoRename = "OFF"
' WARNING!!! SENSITIVE DATA: user name and password.
MySite.Login = "*******"
MySite.Password = "*******"
MySite.SocksInfo = ""
MySite.ProxyInfo = ""
' Connect to remote server
MySite.Upload "D:\DailyLetterRun&RSFUploads\Letters\L" & Format(Date, "mmddyy") & "t", "/L" & Format(Date, "mmddyy") & "t"

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP in VB Question hexOffender VB.NET 2002/2003 Basics 0 November 15th, 2006 10:48 AM
error in my email vbs script femig VBScript 1 April 15th, 2005 06:26 AM
Automation error The object invoked has disconnect vensee Crystal Reports 0 April 11th, 2005 06:12 PM
VBS and FTP red4vbs VBScript 0 January 15th, 2005 12:59 PM
File copy routine error! Janet C++ Programming 3 March 13th, 2004 02:41 PM

All times are GMT -4. The time now is 09:57 PM.

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