Avatar billede flemming39 Nybegynder
22. august 2005 - 20:34 Der er 18 kommentarer og
1 løsning

ftp upload virker ikke længere!

Hej

Jeg får en fejl 438 som så vidt jeg kan finde frem til betyder at et objekt ikke findes.
Min ftp ser ud som vist nedenfor og en bruger fortæller at funktionen har virket indtil jeg idriftsatte nogle andre ændringer som dog ikke umiddelbart har noget som helst med ftp funktionen at gøre.
    With ctlInternet
        .RequestTimeout = 1000
        .AccessType = icDirect
        .Protocol = icFTP
        .URL = txtURL
        .UserName = txtUser
        .Password = txtPassword
        .Execute , "PUT C:\" & EmneKatalog & "\db.mdb \db.mdb"
    End With

Der er stort set ingen hjælp at hente når jeg googler på ctlinternet. Jeg har micrsoftInternetControl 6.0 "krydset af" i references.

Er der nogen der kan give et bud på hvad der er sket/gået galt?
Skal jeg benytte en anden approach?

mvh Flemming
Avatar billede terry Ekspert
22. august 2005 - 20:41 #1
have you tried compiling your code to see if you get any errors?

I havent used FTP so much but I used this with success!

http://www.mvps.org/access/modules/mdl0037.htm
Avatar billede flemming39 Nybegynder
22. august 2005 - 20:53 #2
There is now errors in my compiling and when i debug the error module is called with err.number 438 when I hit the line "With ctlinternet".

I will try your approach if noone can give me a clue but I hope that there is a simple way out of this since the function has been working well in the past and because I hate it when something just starts not to work anymore :-)
Avatar billede terry Ekspert
22. august 2005 - 20:55 #3
ctlinternet must be declared somewhere in the program

Dim ctlinternet as .....
Avatar billede flemming39 Nybegynder
22. august 2005 - 21:40 #4
ctlInternet is an object and i think it is a "build in" because when i wright cltinternet.(dot) then i get a combobox (with a palette of choices) like when you write dim xxx as .... now you get a combo with a palette of choices.

regards Flemming
Avatar billede flemming39 Nybegynder
22. august 2005 - 21:45 #5
but no choices for accesstype, requesttype, user, and so on.....
Avatar billede flemming39 Nybegynder
22. august 2005 - 22:15 #6
Fejl som jeg får i mine videre debug undersøgelser:

"Der er intet objekt i dette kontrolelement"
og et utallige antal med forekomsten..
"Det indtastede indtryk indeholder en ugyldig reference til egenskaben xxxx...x
"
Avatar billede flemming39 Nybegynder
22. august 2005 - 22:32 #7
The only thing i found on google is this, which tells me that I have the control but not access to the object (cltinternet.requesttype, .accesstype and so on). Is'nt the control and object one thing??:

Hi All:

This is my first post to this group and I hope someone can help me. This
is my setup and dilemma.

I have VB6 and IE6. I am trying to setup a program to pull down some
files from a FTP site. According to what I've learned so far, I should
be able to include the internet control (named ctlInternet) on my form
and use the following code, as example:

Dim strURL as String
Dim strSource as String
Dim strDest as String
strURL = "FTP://ftp.microsoft.com/developr"
strSource = "readme.txt"
strDest = "C:\Temp\readme.txt"
ctlInternet.Execute strURL, "GET " & strSource & " " & strDest

The above ftp site is a valid site and the file exists, I can get there
from IE6. However, when I try to run this code I get Error #35754
"Unable to connect to remote host"
Avatar billede terry Ekspert
23. august 2005 - 11:28 #8
I've never used this control butI would think that it can be added to the form from the toolbox. OR it has to be declared before use!

I'll have a play around and see if I can shed some light on th eproblem!
Avatar billede terry Ekspert
23. august 2005 - 12:25 #9
which control do you have a reference to and which file is it using?
Avatar billede flemming39 Nybegynder
23. august 2005 - 14:15 #10
It is the Micrsoft Internet Control 6.0 im having a reference to. It is included in the MSINET.OCX module, and I have found many examples (googling) where it is right to use the command "with FTP...." instead of "with cltinternet ..." which is very rarely used. I will try FTP instead of ctlinternet when I get back to my home tonight. But im still wondering why the call "with ctlinternet ..." has been doing the job two month ago and now NOT????

I will write you about the result of my trying on the FTP command (instead of ctlinternet) when I get back tonight.

Thanks for your guidence so far

Regards Flemming
Avatar billede terry Ekspert
23. august 2005 - 20:34 #11
Flemming, the control is normally included when you install VB 6.0. Then you will be able to add the control to your form from the toolbox. If you can not find it in th etoolbox then you need to re-install it!

I actually found a similar example on my PC, and as far as I know I NEVER got it working. Thats why I wen over to the other idea.

But it may help just by installing the control again
Avatar billede flemming39 Nybegynder
23. august 2005 - 23:33 #12
I have tried to get it to work but whatever i do I keep on getting to a point where the object cant be created .... I give up on the control and use the approach you have suggested; tommorow though , now i'll go to sleep :-)
Avatar billede flemming39 Nybegynder
27. august 2005 - 18:37 #13
Jeg har sat flueben i references til internetTransferlib, som jeg har downloadet, og er igang med at få ftp uploaden til at virke men..
Når jeg kompilerer får jeg fejl i linien Set objftp = new internetTransferlib.ftp
"Invalid use of New keyword"
Jeg arbejder på access 2000

Den kode som jeg har tilpasset ser sådan ud:
On Error GoTo ErrHandler
Dim objFTP As internetTransferlib.FTP
Set objFTP = New internetTransferlib.FTP
 
  With objFTP
    .FtpURL = txtURL
    .SourceFile = "C:\" & EmneKatalog & "\db.mdb"
    .DestinationFile = "\db.mdb"""
    .AutoCreateRemoteDir = True
    If Not .IsConnected Then .DialDefaultNumber
    .ConnectToFTPHost txtUser, txtPassword
    .UploadFileToFTPServer
  End With
ExitHere:
  On Error Resume Next
  Set objFTP = Nothing
  Call SysCmd(acSysCmdRemoveMeter)
  Exit Sub
ErrHandler:
  MsgBox err.Number & vbCrLf & err.Description, _
      vbCritical + vbOKOnly, err.source
  Resume ExitHere
Avatar billede terry Ekspert
28. august 2005 - 10:37 #14
Hi Flemming
Try

Dim objFTP As FTP

Set objFTP = New FTP
Avatar billede terry Ekspert
28. august 2005 - 10:42 #15
In Access 97 you need a reference to the MDA field which contains the code. In Access 2000 and greater you shoudlo have the classes imported into you database. One of the classes is named FTP and theat why you only need to wriet

..AS FTP
Avatar billede terry Ekspert
28. august 2005 - 10:43 #16
wriet = write
Avatar billede terry Ekspert
28. august 2005 - 20:43 #17
Thanks Flemming, hope you got it working?
Avatar billede flemming39 Nybegynder
28. august 2005 - 20:44 #18
Thanks Terry it works.

I have been out playing a bridge turnament today, with no prizes for me. But comming back and see the ftp working is a lot better :-)

Thanks.
Avatar billede terry Ekspert
28. august 2005 - 20:47 #19
bad luck with bridge, better luck next time. and great to hear the FTP works :o)

And you now have access to HTTP upload and download too.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester