Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VB6 Internet Transfer Control

792 views
Skip to first unread message

Tim Cull

unread,
Nov 17, 1998, 3:00:00 AM11/17/98
to
I'm trying to write a server side ActiveX dll that will not have any
visual
interface (ie. no forms on which to paste the Inet control) and I'm
trying
to use the Internet Transfer Control 6.0. I've added a reference to the

msinet.ocx control to my project. I need to connect to an FTP account
which
requires a user name and password.

I'm new to VB6 from VB4 and have never used the Internet Transfer
Control
before, but I can't get the Execute method to work at all on either FTP
or
HTTP, even when I cut and paste the code directly from the examples in
MSDN.
I get a message with error number 35754 'Unable to connect to remote
host.'
I added an error handler and Err says that Method 'Execute' in 'Inet'
failed. The OpenURL works, though. In the Knowledge Base I see
messages
about Studio97 sp2 Internet Transfer Control bugs left and right for the

Execute method that were fixed in sp3. I'm assuming that since this is
VB6
I shouldn't need to install VB5sp3.

Has anyone successfully used the ITC in Visual Basic 6? I can find a
lot
about ITCv5.0 but nothing about ITCv6.0 in MSDN.

--Tim Cull


hatch...@my-dejanews.com

unread,
Dec 2, 1998, 3:00:00 AM12/2/98
to
In article <3651EE07...@ucdavis.edu>,
VB6 is supposed to be a superset of the latest VB5 version. As far as the
execute technique...

Try this example. It works!

Inet1.Accesstype = icUseDefault
Inet1.Protocol = icFTP

Dim VbSP as String: VbSp = " "
Dim RemoteIP as String: RemoteIP = "10.11.12.13"
Dim UserName as String: UserName = "Joebob"
Dim Password as String: Password = "BobJoe"
Dim RemoteSubDirectory as String: RemoteSubDirectory = "JoeBobs_Files"
Dim LocalDirectory as String: LocalDirectory = "C:\downloads"
Dim RemoteHost = "FTP://" & UserName & ":" & Password & "@" _RemoteIP & "/"

Private Sub Command1_Click()
Inet1.Execute RemoteHost, "CD" & VbSp & RemoteSubDirectory
Call Waitloop
Inet1.Execute RemoteHost, "GET" & VbSp & "myfile.dat" & VbSp & _
LocalDirectory & "\" & "stillmyfile.dat"
Call Waitloop

sub WaitLoop()
Do
DoEvents
Loop While Inet1.StillExecuting
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
' Retrieve server response using the GetChunk
' method when State = 12.

lblResponsePath.Caption = ""
Inet1.RequestTimeout = 5
Select Case State
' ... Other cases not shown.
Case icError ' 11
' In case of error, return ResponseCode and
' ResponseInfo.
vtData = Inet1.ResponseCode & ":" & _
Inet1.ResponseInfo

Case icResponseCompleted ' 12
vtData = Inet1.GetChunk(1024)
End Select
lblResponsePath.Caption = vtData ' Raw Data from remote host
End Sub


--
Didja ever notice they're is always one in the crowd...
And he is in front of you!!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

0 new messages