Using Activex control inet - TechRepublic
General discussion
July 26, 2005 at 08:34 AM
bentz

Using Activex control inet

by bentz . Updated 20 years, 11 months ago

I have written an MS access module that uses the inet activex control to ftp a file from one of our mainframes to a pc.

The file is a consecutive file with a record lenght of 350 chars.

If I use ftp through the dos prompt the file downloads fine. I don’t use an special parameters or settings thru dos just a get statement. When I use the access program that uses the active x control it downloads the file with a length of 1022 chars. Needless to say the data is not in a fixed file format. I’ve tried multiple files with different size records and they are still downloaded with record size of 1022 chars. I cannot find any reference to the record length using this control. If anyone has any ideas please enlighten me. I have added the code used in the module. (changed some names to protect the innocent but you get the idea)

Option Compare Database
Option Explicit
‘Create Public Variables
Dim objFTP As Inet
Dim strSite As String
Dim strFile As String
Dim strMonth As String
Dim strYear As String
Dim strType As String
Private Sub Form_Load()
‘ Set a reference to the Internet transfercontrol.
Set objFTP = Me!axFTP.Object
objFTP.Protocol = icFTP
strSite = “172.17.17.1”
objFTP.URL = strSite
objFTP.UserName = “USER”
objFTP.Password = “PASSWORD”
End Sub
Private Sub cmd_Click()
On Error GoTo Err_cmd_Click

strFile = “wic001\data\file”
‘Run Control to transfer file
objFTP.Execute , “Get ” & strFile & ” C:\test\test.txt”
Exit_cmd_Click:
Exit Sub

Err_cmd_Click:
MsgBox Err.Description
Resume Exit_cmd_Click
End Sub

This discussion is locked

All Comments