473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

error in .vbs FTP routine invoked from VB 6.0

5
(sorry if this belongs in another thread, I didn't find a VBscript one...)
Hello,
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
L020707t

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,
david

[code]
' 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.Connect
MySite.Upload "D:\DailyLetterRun&RSFUploads\Letters\L" & Format(Date, "mmddyy") & "t", "/L" & Format(Date, "mmddyy") & "t"
MySite.Disconnect
[\code]
Feb 7 '07 #1
1 1893
Killer42
8,435 Expert 8TB
Just a quick guess - maybe you need to use Now rather than Date?
Feb 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Doslil | last post by:
I am trying to validate a text field where the user has to input the first name I am writing the following function Private Function EFN() On Error GoTo EFNErr If IsNull(Me.FirstName) Or...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: Miranda Evans | last post by:
I noticed several postings about issues related to "run-time error 3061", and I observed that the solutions to these issues appear to involve correcting something within the SQL code. I'm...
2
by: Susan Bricker | last post by:
Greetings Experts ... I have a routine that is invoked when a command button is clicked. The button is located in a form that is tied to a table of Project records. Each Project Record has 0 to...
2
by: Steve Richfield | last post by:
My error handler works GREAT. However, VBA seems to have some bugs/features that are causing it fits. The little snippet that I put at the end of each routine looks like this: Error_Handler: If...
7
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
5
by: Erwin Lindemann | last post by:
Hi group! I found the following code in a free unix program and used it successfully in a couple of programs. But for some reason it does not compile under Windows. Here's the code: ...
3
by: Pallav singh | last post by:
Hi All i am getting Error while writing following code for state design Pattern kindly let me know How to Correct this Error ?? Thanks Pallav Singh ...
10
by: pereges | last post by:
How to to go about this ? Suppose a malloc inside a recursive function has failed and you want to set the error flag and return it to the calling function(the one which called the recursive...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.