Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBSCRIPT F/DTS PACKAGE TO UPLOAD TEXT FILES

Status
Not open for further replies.

ECATES

Technical User
Jun 20, 2003
6
0
0
US
Need help with setting up a VBScript for uploading Text Files to an FTP server. Try to write a VBscript for a DTS
package that will accomplish this.

This is the Code I Tried'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()


inet1.URL="ftp://161.58.223.183"
inet1.username=&quot;<myusername>&quot;
inet1.password=&quot;<mypassword>&quot;
inet1.execute &quot;PUT c:\website_export_files\cutomer_data.txt customer_data.txt&quot;
inet1.execute &quot;close&quot;
inet1.execute &quot;quit&quot;

Main = DTSTaskExecResult_Success
End Function

error message -->object required 'inet1'
&quot; error in line 7 &quot;

Any help would be appreciated

 
what is inet1? is it an ftp object? if so you need to initalize the object so the prog knows what it its
 
Corran007

Thanks so much for the help. I have read that in VB the
INET1.* is the Internet transfer control for VB. The way I
understood what I read was to set the INET1.protocol=icFTP.
The INET1.URL=(ftp://username:password@<ftp_site_address>

The commands following the INET1. are in fact FTP commands.
ie.... INET1.execute &quot;PUT......&quot;

Using the ActiveX task in a DTS package seems to require that it must be a Function(). A function must return a value. I suppose I would have to set up a BOOLEAN to return
indicated whether the files had uploaded. Still cannot get it to work.

Ecates
 
I changed this from another post that was showed how to do a http request by Devastated but is really just a rehash of what the previous 2 posters said



Taken From:-

Here is the basic code for an FTP request:

Set Inet = Server.CreateObject(&quot;InetCtls.Inet.1&quot;)
inet.URL=&quot;ftp://161.58.223.183&quot;;
'Inet.UserName = &quot;MyUserName&quot;
'Inet.Password = &quot;MyPassword&quot;
Inet.AccessType =icFTP
Inet.RequestTimeout = 60
inet.execute &quot;PUT c:\website_export_files\cutomer_data.txt customer_data.txt&quot;
inet.execute &quot;close&quot;
inet.execute &quot;quit&quot;
Set Inet = Nothing
 
EVILLA,

Thanks a bunch for your help. I don't think we are on the right track, or at least not me anyway. It has to be a VBscript and not VB. What I am trying to do is write a ActiveX script (VBscript) in a DTS package that will upload some text files to a FTP server on the WEB.

INET is a dimension of Internet Transfer Control for Visual Basic. Right??? Not sure that this will work with VBscript.
Nothing in the literature on it.

Any other Ideas? Again thanks for the reply. Your help in
this matter is greatly appreciated

ecates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top