Use of ftp transfer in Access2000 and Access2003

R

ReidarT

I use an activeX control to upload files from a local machine to a Web-site.
I use the activeX-control msinet.ocx.
This works fine on my Notebook with Office 2003 installed.
I have copied the application to another network, copied the
activeX-component to system32 folder, registered the component sucessfully.
Here is the code
1 Dim strHostName As String
2 Dim strUserName As String
3 Dim strPassword As String
4 Dim LocalFileName As String
5 Dim RemoteFileName As String
6 Dim ftp As Inet
7 LocalFileName = "H:\path\access.mdb"
8 RemoteFileName = "www.url.com/access.mdb"
9 strHostName = "www.url.com"
10 strUserName = "username"
11 strPassword = "password"

12 'RemoteFileName = strRemotePath & strExpFilNavn
13 Set ftp = New Inet
14 With ftp
15 .Protocol = icFTP
16 .RemoteHost = strHostName
17 .UserName = strUserName
18 .Password = strPassword
19 .Execute .URL, "Put " + LocalFileName + " " + RemoteFileName
20 Do While .StillExecuting
21 DoEvents
22 Loop
23 End With
24 Set ftp = Nothing

On the Access2000 version it stops on line 6.

regards
reidarT
 
M

Michel Walsh

Hi,


Inet is not a class/type defined in the default libraries (references).
You may miss a reference in your project.



Hoping it may help,
Vanderghast, Access MVP
 
R

ReidarT

As you can see from my mail, I have registered the ocx and added it to
references. There must be something else.
How many files have to be included in addition to msinet.ocx. There is an
msinet.dep file?
regards
reidarT
 
M

Michel Walsh

HI,


Even if the ActiveX is registered and the ActiveX uses internally an
INet object, the VBA project does not see the references embedded in the
ActiveX (the references in the ActiveX are "local" to it, as its variables,
by comparison), so if your VBA code need INet, your VBA code need to add, in
ITS References... (from the VBE menu) the library supplying the INet class.
You are right about you don't need to add the library in the References if
your VBA code just use the exposed (public) functionalities of your ActiveX.
But the code you supplied seems it needs more that just your ActiveX, since
your code declares an INet object, alone, independently (at least, it starts
its life independently) of your ActiveX.



Hoping it may help,
Vanderghast, Access MVP
 
R

ReidarT

The same function works OK in VB6
regards
reidarT
Michel Walsh said:
HI,


Even if the ActiveX is registered and the ActiveX uses internally an
INet object, the VBA project does not see the references embedded in the
ActiveX (the references in the ActiveX are "local" to it, as its
variables, by comparison), so if your VBA code need INet, your VBA code
need to add, in ITS References... (from the VBE menu) the library
supplying the INet class. You are right about you don't need to add the
library in the References if your VBA code just use the exposed (public)
functionalities of your ActiveX. But the code you supplied seems it needs
more that just your ActiveX, since your code declares an INet object,
alone, independently (at least, it starts its life independently) of your
ActiveX.



Hoping it may help,
Vanderghast, Access MVP
 
B

Brian

I'm baffled. You are using an ActiveX control, so why are you trying to
declare it? Makes no sense at all. I've just finished a project using the
Internet Transfer Control, doing pretty much what you are doing, and it
works fine as a regular ActiveX control. I don't need to/cannot declare an
object of type "Inet", whatever that is. The only way I can see that your
code makes sense is if you/someone has, for some reason, created a class
"Inet" which encapsulates an Internet Transfer Control.

(Sorry for top posting, just following the pattern for this thread)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top