Copy File to Linux Server

I'm trying to write some vb code (to eventually become VBA code within
Excel) that can copy a file from my client pc to my linux server and
rename it (or, if not possible, to leave the name the same).

After much searching on the net, this is what I've come up with so
far.



Option Explicit


Private Declare Function InternetCloseHandle Lib "wininet" (ByRef
hInet As Long) As Long
Private Declare Function InternetConnect Lib "wininet.dll" Alias
"InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName
As String, ByVal nServerPort As Integer, ByVal sUserName As String,
ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As
Long, ByVal lContext As Long) As Long
Private Declare Function InternetOpen Lib "wininet.dll" Alias
"InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long,
ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags
As Long) As Long
Private Declare Function FtpSetCurrentDirectory Lib "wininet.dll"
Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal
lpszDirectory As String) As Boolean
Private Declare Function FtpGetCurrentDirectory Lib "wininet.dll"
Alias "FtpGetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal
lpszCurrentDirectory As String, lpdwCurrentDirectory As Long) As Long
Private Declare Function FtpCreateDirectory Lib "wininet.dll" Alias
"FtpCreateDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory
As String) As Boolean
Private Declare Function FtpRemoveDirectory Lib "wininet.dll" Alias
"FtpRemoveDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory
As String) As Boolean
Private Declare Function FtpDeleteFile Lib "wininet.dll" Alias
"FtpDeleteFileA" (ByVal hFtpSession As Long, ByVal lpszFileName As
String) As Boolean
Private Declare Function FtpRenameFile Lib "wininet.dll" Alias
"FtpRenameFileA" (ByVal hFtpSession As Long, ByVal lpszExisting As
String, ByVal lpszNew As String) As Boolean
Private Declare Function FtpGetFile Lib "wininet.dll" Alias
"FtpGetFileA" (ByVal hConnect As Long, ByVal lpszRemoteFile As String,
ByVal lpszNewFile As String, ByVal fFailIfExists As Long, ByVal
dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByRef dwContext
As Long) As Boolean
Private Declare Function FtpPutFile Lib "wininet.dll" Alias
"FtpPutFileA" (ByVal hConnect As Long, ByVal lpszLocalFile As String,
ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal
dwContext As Long) As Boolean
Private Declare Function InternetGetLastResponseInfo Lib "wininet.dll"
Alias "InternetGetLastResponseInfoA" (lpdwError As Long, ByVal
lpszBuffer As String, lpdwBufferLength As Long) As Boolean
Const FTP_TRANSFER_TYPE_UNKNOWN = &H0
Const FTP_TRANSFER_TYPE_ASCII = &H1
Const FTP_TRANSFER_TYPE_BINARY = &H2
Const INTERNET_DEFAULT_FTP_PORT = 21               ' default for FTP
servers
Const INTERNET_SERVICE_FTP = 1
Const INTERNET_FLAG_PASSIVE = &H8000000            ' used for FTP
connections
Const INTERNET_OPEN_TYPE_PRECONFIG = 0                    ' use
registry configuration
Const INTERNET_OPEN_TYPE_DIRECT = 1                        ' direct to
net
Const INTERNET_OPEN_TYPE_PROXY = 3                         ' via named
proxy
Const INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY = 4   ' prevent
using java/script/INS
Const MAX_PATH = 260
Const PassiveConnection As Boolean = True



Public Sub LogToFtp()

    Dim ftpfolder As String
    Dim hConnection As Long, hOpen As Long, sOrgPath  As String

On Error GoTo fout

        
        
        'open an internet connection
        hOpen = InternetOpen("", 4, vbNullString, vbNullString, 0)
        'connect to the FTP server
        hConnection = InternetConnect(hOpen, "ftp.mydomain.com",
INTERNET_DEFAULT_FTP_PORT, "buffy", "12Vampire", INTERNET_SERVICE_FTP,
IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)
        'create a buffer to store the original directory
        sOrgPath = String(MAX_PATH, 0)
        'get the directory
        FtpGetCurrentDirectory hConnection, sOrgPath, Len(sOrgPath)
        'create a new directory 'testing'
        ftpfolder = "testing"
        FtpCreateDirectory hConnection, ftpfolder
        'set the current directory to 'root/testing'
        FtpSetCurrentDirectory hConnection, ftpfolder
        'upload the file 'myfile.txt'
        FtpPutFile hConnection, "C:\temp\myfile.txt", "myfile.fdr",
FTP_TRANSFER_TYPE_UNKNOWN, 0
        'enumerate the file list from the current directory
('root/testing')
    '    EnumFiles hConnection
        'set the current directory back to the root
        FtpSetCurrentDirectory hConnection, sOrgPath
        'close the FTP connection
        InternetCloseHandle hConnection
        'close the internet connection
        InternetCloseHandle hOpen
        
fout:
    
End Sub


Assume the domain name is "mydomain.com" and the file is from
"c:\temp\myfile.txt". I want to write this file into a directory
called "testing".

When I ran the above code, there was no indication that something had
indeed happened. So I know that somewhere here I need to be able to
return a status as to what has occurred or to say "It worked!" or
whatever.

However, when I checked the server after running the code, it did in
fact create a folder called "testing". However, my file was not copied
into this directory as it was empty.

The FTP subject via VB (or VBA) is a bit technical for me at this
time. If someone knowledgeable about this could comment on what I'm
not doing here correctly I would appreciate it.

On another note, if it is possible to copy a file to the linux server
via VB, then I have to assume it is also possible to copy it back
again without the need for PHP or some other intermediary script. Yes?

Also, if the directory and/file is already there when I try to copy
the file to the server, I need it to 'overwrite' it.

Any suggestions, tips, clues, etc?

Thanks.

Webbiz

0
Webbiz
3/16/2010 9:51:01 PM
vb.general.discussion 1016 articles. 0 followers. Follow

28 Replies
1126 Views

Similar Articles

[PageSpeed] 39

Webbiz wrote:
> When I ran the above code, there was no indication that something had
> indeed happened. So I know that somewhere here I need to be able to
> return a status as to what has occurred or to say "It worked!" or
> whatever.

Are you aware of the F8/F9 keys, and how to use them?

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/16/2010 9:54:35 PM
On Tue, 16 Mar 2010 14:54:35 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

>Webbiz wrote:
>> When I ran the above code, there was no indication that something had
>> indeed happened. So I know that somewhere here I need to be able to
>> return a status as to what has occurred or to say "It worked!" or
>> whatever.
>
>Are you aware of the F8/F9 keys, and how to use them?

Yes Karl. That's not it. I stepped through the darn thing and get
nothing. My question was more directed at what I could plug into the
code to make it tell me what the server was saying was happening.

Again my ingliss not soo goood.  :-b

Anyway, I'm curious if using the Microsoft Internet Transfer Control
is a simplier and better way to go than API for simple file upload and
download. So I'm scratching this code and trying out a microsoft
example (that isn't working either, but there is less lines :)

This is in the Forms (General)

Dim objFTP As Inet


This is in the Forms_Load()

    Set objFTP = Me!axFTP.Object

(the control is named axFTP)


I get this error:

Run-time error '13'.

Type mismatch.

This from a Microsoft MSDN page.

Any idea why "Set objFTP = Me!axFTP.Object" causes this error?

Thanks.

Webbiz



0
Webbiz
3/16/2010 11:22:53 PM
Webbiz wrote:
> Karl E. Peterson <karl@exmvps.org> wrote:
>
>> Webbiz wrote:
>>> When I ran the above code, there was no indication that something had
>>> indeed happened. So I know that somewhere here I need to be able to
>>> return a status as to what has occurred or to say "It worked!" or
>>> whatever.
>> 
>> Are you aware of the F8/F9 keys, and how to use them?
>
> Yes Karl. That's not it. I stepped through the darn thing and get
> nothing.

Okay, didn't mean that to sound (too!) condescending. <g>

> My question was more directed at what I could plug into the
> code to make it tell me what the server was saying was happening.

I'd be looking at the return value of each API call.  Immediately.  
Right as/after they were made.

> Anyway, I'm curious if using the Microsoft Internet Transfer Control
> is a simplier and better way to go than API for simple file upload and
> download.

Might be.  Sorta depends on the guy, I think.  For me, it's simpler to 
take my car in for an oil change.  Other guys wouldn't think of doing 
that.

> So I'm scratching this code and trying out a microsoft
> example (that isn't working either, but there is less lines :)
>
> This is in the Forms (General)
>
> Dim objFTP As Inet
>
>
> This is in the Forms_Load()
>
>     Set objFTP = Me!axFTP.Object
>
> (the control is named axFTP)
>
>
> I get this error:
>
> Run-time error '13'.
>
> Type mismatch.
>
> This from a Microsoft MSDN page.
>
> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?

The object type being returned isn't the same as the variable you're 
trying to assign it to.

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 12:09:25 AM
On Tue, 16 Mar 2010 17:09:25 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:


>>
>> This is in the Forms (General)
>>
>> Dim objFTP As Inet
>>
>>
>> This is in the Forms_Load()
>>
>>     Set objFTP = Me!axFTP.Object
>>
>> (the control is named axFTP)
>>
>>
>> I get this error:
>>
>> Run-time error '13'.
>>
>> Type mismatch.
>>
>> This from a Microsoft MSDN page.
>>
>> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?
>
>The object type being returned isn't the same as the variable you're 
>trying to assign it to.


1. Why then does Microsoft MSDN use this as an example if not correct?

2. Why are they not the same object type? The Inet control is simply
named axFTP. The objFTP variable is declared as type Inet. 

3. Are you suggesting that the method ".Object" within the Inet
control does not return an object of type Inet?

Thanks.

Webbiz
0
Webbiz
3/17/2010 1:58:27 AM
Webbiz wrote:
>>> This is in the Forms (General)
>>> 
>>> Dim objFTP As Inet
>>> 
>>> 
>>> This is in the Forms_Load()
>>> 
>>>     Set objFTP = Me!axFTP.Object
>>> 
>>> (the control is named axFTP)
>>> 
>>> 
>>> I get this error:
>>> 
>>> Run-time error '13'.
>>> 
>>> Type mismatch.
>>> 
>>> This from a Microsoft MSDN page.
>>> 
>>> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?
>> 
>> The object type being returned isn't the same as the variable you're 
>> trying to assign it to.
>
> 1. Why then does Microsoft MSDN use this as an example if not correct?

Wow, does this *look* like a mountaintop I'm sitting on?

Hell, how would I know?  They're probably the single *worst* example of 
how to code in ClassicVB that there is.  You asked what a "Type 
Mismatch" error meant, and I told you.

> 2. Why are they not the same object type? The Inet control is simply
> named axFTP. The objFTP variable is declared as type Inet. 

No idea.  Never used that control.

> 3. Are you suggesting that the method ".Object" within the Inet
> control does not return an object of type Inet?

I just told you what the error means.  Hopefully, someone who's used 
that control would be more familiar with its object model.  But yeah, 
that's the gist of it, assuming that's the only issue in play.

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 2:02:56 AM
"Webbiz" <nospam@noway.com> wrote in message 
news:rntvp5dv6sjlo05nn30jnrr74hph71br2g@4ax.com...
> I'm trying to write some vb code (to eventually become VBA code within
> Excel) that can copy a file from my client pc to my linux server and
> rename it (or, if not possible, to leave the name the same).
>
> After much searching on the net, this is what I've come up with so
> far.

Besides FTP, look up "HTTP Upload". Also, since you plan to use VBA with 
this, I don't think you can redistribute INet control with it, besides, the 
INet control is buggy. WinInet API is more reliable.


0
Nobody
3/17/2010 2:04:06 AM
On Tue, 16 Mar 2010 19:02:56 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

>Webbiz wrote:
>>>> This is in the Forms (General)
>>>> 
>>>> Dim objFTP As Inet
>>>> 
>>>> 
>>>> This is in the Forms_Load()
>>>> 
>>>>     Set objFTP = Me!axFTP.Object
>>>> 
>>>> (the control is named axFTP)
>>>> 
>>>> 
>>>> I get this error:
>>>> 
>>>> Run-time error '13'.
>>>> 
>>>> Type mismatch.
>>>> 
>>>> This from a Microsoft MSDN page.
>>>> 
>>>> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?
>>> 
>>> The object type being returned isn't the same as the variable you're 
>>> trying to assign it to.
>>
>> 1. Why then does Microsoft MSDN use this as an example if not correct?
>
>Wow, does this *look* like a mountaintop I'm sitting on?
>
>Hell, how would I know?  They're probably the single *worst* example of 
>how to code in ClassicVB that there is.  You asked what a "Type 
>Mismatch" error meant, and I told you.
>
>> 2. Why are they not the same object type? The Inet control is simply
>> named axFTP. The objFTP variable is declared as type Inet. 
>
>No idea.  Never used that control.
>
>> 3. Are you suggesting that the method ".Object" within the Inet
>> control does not return an object of type Inet?
>
>I just told you what the error means.  Hopefully, someone who's used 
>that control would be more familiar with its object model.  But yeah, 
>that's the gist of it, assuming that's the only issue in play.


Sheesh Karl, what gives? First you start off being condensending with
that F8-9 comment, then you slap me silly and call me Lucy. And to
make it worse, you never used the control???

I know what the error is. Just like I know what F8 and F9 does. That
isn't what I asked. I know my English isn't the greatest, but
seriously? I was not the one who papered your house or egged your car,
so take it easy big guy, I bruise easily.

I'm asking WHY would I get an error that it is the wrong object type
being assigned a variable that is clearly declared as that object
type?

Webbiz
0
Webbiz
3/17/2010 2:23:12 AM
"Karl E. Peterson" <karl@exmvps.org> wrote in message 
news:%23EBYbYWxKHA.404@TK2MSFTNGP02.phx.gbl...
> Webbiz wrote:
>> Karl E. Peterson <karl@exmvps.org> wrote:
>>
>>> Webbiz wrote:
>>>> When I ran the above code, there was no indication that something had
>>>> indeed happened. So I know that somewhere here I need to be able to
>>>> return a status as to what has occurred or to say "It worked!" or
>>>> whatever.
>>>
>>> Are you aware of the F8/F9 keys, and how to use them?
>>
>> Yes Karl. That's not it. I stepped through the darn thing and get
>> nothing.
>
> Okay, didn't mean that to sound (too!) condescending. <g>
>
>> My question was more directed at what I could plug into the
>> code to make it tell me what the server was saying was happening.
>
> I'd be looking at the return value of each API call.  Immediately.  Right 
> as/after they were made.

possibly along with Err.LastDllError

0
Bob
3/17/2010 2:24:01 AM
On Tue, 16 Mar 2010 21:04:06 -0500, "Nobody" <nobody@nobody.com>
wrote:

>"Webbiz" <nospam@noway.com> wrote in message 
>news:rntvp5dv6sjlo05nn30jnrr74hph71br2g@4ax.com...
>> I'm trying to write some vb code (to eventually become VBA code within
>> Excel) that can copy a file from my client pc to my linux server and
>> rename it (or, if not possible, to leave the name the same).
>>
>> After much searching on the net, this is what I've come up with so
>> far.
>
>Besides FTP, look up "HTTP Upload". Also, since you plan to use VBA with 
>this, I don't think you can redistribute INet control with it, besides, the 
>INet control is buggy. WinInet API is more reliable.
>

Okay, I'll look up "HTTP Upload". Don't know what the difference is
but will likely find out when I look it up.

Thanks.

Webbiz
0
Webbiz
3/17/2010 2:24:38 AM
"Webbiz" <nospam@noway.com> wrote in message 
news:e9f0q5lep9q05sbahohsn8a6qhs05h400v@4ax.com...
> Okay, I'll look up "HTTP Upload". Don't know what the difference is
> but will likely find out when I look it up.

If you uploaded images to eBay or some image hosting site that has a 
"Browse" button, then you have used HTTP Upload. See this page and click on 
Browse:

http://xs.to



0
Nobody
3/17/2010 2:27:52 AM
On Tue, 16 Mar 2010 21:27:52 -0500, "Nobody" <nobody@nobody.com>
wrote:

>"Webbiz" <nospam@noway.com> wrote in message 
>news:e9f0q5lep9q05sbahohsn8a6qhs05h400v@4ax.com...
>> Okay, I'll look up "HTTP Upload". Don't know what the difference is
>> but will likely find out when I look it up.
>
>If you uploaded images to eBay or some image hosting site that has a 
>"Browse" button, then you have used HTTP Upload. See this page and click on 
>Browse:
>
>http://xs.to
>


Been doing a lot of searching and haven't yet discovered a solution.
This HTTP upload thing has now added to the pile up.

I came across a Chilkat component for upload and the component didn't
install right. I tried a HTTP Upload example and nothing is uploaded.

And then there is the question as to why these HTTP upload examples
that I've come across never say anything about Username/Password for
access to the site. I'm thinking, "people cannot just upload stuff to
your site without some kind of permission...". So this is a bit
confusing too.


Then it dawned on me, "hey, I have a whole library of VB6 books. One
of them at least must touch on this subject."

Well, I have a book called "Professional VB6 Web Programming". A
shiney brand new book that's been sitting there for a very long time.
Guess now is a good time to crack the thing open.

Thanks amigo.

Webbiz
0
Webbiz
3/17/2010 3:19:04 AM
"Webbiz" <nospam@noway.com> wrote in message 
news:a9i0q55j89sq3p46bt7h2cv60is1na7fot@4ax.com...
> Been doing a lot of searching and haven't yet discovered a solution.
> This HTTP upload thing has now added to the pile up.
>
> I came across a Chilkat component for upload and the component didn't
> install right. I tried a HTTP Upload example and nothing is uploaded.
>
> And then there is the question as to why these HTTP upload examples
> that I've come across never say anything about Username/Password for
> access to the site. I'm thinking, "people cannot just upload stuff to
> your site without some kind of permission...". So this is a bit
> confusing too.

Permissions and access are so easy with PHP/ASP:

<?php
if ($_POST["Password"]=="secret") {
  echo 'Okay';
  // Do file upload here
} else {
  echo 'Not okay';
}
?>

This could be based on a database. That's how online forums work, except 
that they use MD5 to store passwords, and compare the MD5 on the database 
with the entered password. If they are the same, then the password is the 
same.

> Then it dawned on me, "hey, I have a whole library of VB6 books. One
> of them at least must touch on this subject."
>
> Well, I have a book called "Professional VB6 Web Programming". A
> shiney brand new book that's been sitting there for a very long time.
> Guess now is a good time to crack the thing open.

It probably covers using VB with IIS and ASP, not PHP.



0
Nobody
3/17/2010 5:26:40 AM
"Nobody" <nobody@nobody.com> wrote in message 
news:%23WHn4JZxKHA.5936@TK2MSFTNGP04.phx.gbl...
> and compare the MD5 on the database with the entered password.

Meant to say "and compare the MD5 on the database with the MD5 of the 
entered password."



0
Nobody
3/17/2010 6:19:54 AM
IMO you should stick to one method and debug this one. Have you tried to 
check the return value for each and every call in your first code ? This is 
where I would start...

If not choosen yet :
- With FTP, you'll have to configure your Linux server to be a ftp server 
(seems to work as you create a directory (unless you created it earlier ;-))
- With Http, you'll need your linux server to be a web server and have a 
page that gets the uploaded content to save it on the server
- Another option could be to expose your Linux filesystem as a network drive 
(using perhaps something http://en.wikipedia.org/wiki/Samba_(software)). 
Likely gives more admin work but then you'll just another drive.


--
Patrice
 


0
Patrice
3/17/2010 12:58:29 PM
Bob Butler wrote:
>> I'd be looking at the return value of each API call.  Immediately.  Right 
>> as/after they were made.
>
> possibly along with Err.LastDllError

Absolutely.

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 6:56:34 PM
Webbiz wrote:
>>> 1. Why then does Microsoft MSDN use this as an example if not correct?
>> 
>> Wow, does this *look* like a mountaintop I'm sitting on?
>> 
>> Hell, how would I know?  They're probably the single *worst* example of 
>> how to code in ClassicVB that there is.  You asked what a "Type 
>> Mismatch" error meant, and I told you.
>> 
>>> 2. Why are they not the same object type? The Inet control is simply
>>> named axFTP. The objFTP variable is declared as type Inet. 
>> 
>> No idea.  Never used that control.
>> 
>>> 3. Are you suggesting that the method ".Object" within the Inet
>>> control does not return an object of type Inet?
>> 
>> I just told you what the error means.  Hopefully, someone who's used 
>> that control would be more familiar with its object model.  But yeah, 
>> that's the gist of it, assuming that's the only issue in play.
>
> Sheesh Karl, what gives? First you start off being condensending with
> that F8-9 comment, then you slap me silly and call me Lucy. And to
> make it worse, you never used the control???
>
> I know what the error is. Just like I know what F8 and F9 does. That
> isn't what I asked. I know my English isn't the greatest, but
> seriously? I was not the one who papered your house or egged your car,
> so take it easy big guy, I bruise easily.
>
> I'm asking WHY would I get an error that it is the wrong object type
> being assigned a variable that is clearly declared as that object
> type?

When you've ruled out everything else that doesn't make sense, you're 
left with the obvious, eh?

I'm sorry you took it wrongly.  I honestly haven't used that control, 
so I can't offer specific advice.

Have you tried comparing the TypeName's of the two objects?  Or do you 
just think VB is out to get you?  ;-)

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 6:57:59 PM
Webbiz wrote:
> This from a Microsoft MSDN page.
>
> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?

Btw, providing a link always encourages those curious to try recreating 
the error, without having to recreate whatever twisted google query you 
did to find the problem.  HTH!  ;-)

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 7:00:13 PM
On Wed, 17 Mar 2010 11:57:59 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

<more snipper-roo>

>I'm sorry you took it wrongly. <snip>

Karl, you and I certainly have a communications gap. I should add more
smileys and <g>'s to my comments. 

>> Sheesh Karl, what gives? First you start off being condensending with
>> that F8-9 comment, then you slap me silly and call me Lucy. And to
>> make it worse, you never used the control???

"...then you slap me silly and call me Lucy." 

I thought that line would have given it away that it's a
tongue-n-cheek reply to some of your...eh...er... down level
statements. <g> :-) LOL! ROTGLMAO! ;-b  (that should cover it).

>
>Have you tried comparing the TypeName's of the two objects?  Or do you 
>just think VB is out to get you?  ;-)

I definitely think that VB is out to get me. 

Now that I am not sure how to do. How is that done? Seriously.

If I declare a variable of type FUNGUS, and then try set the variable
to a new object of FUNGUS.OBJECT, I'm a bit puzzled why this would not
be the same type. Darn those MSDN people!

:-)
Webbiz



0
Webbiz
3/17/2010 8:21:17 PM
On Wed, 17 Mar 2010 12:00:13 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

>
>Webbiz wrote:
>> This from a Microsoft MSDN page.
>>
>> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?
>
>Btw, providing a link always encourages those curious to try recreating 
>the error, without having to recreate whatever twisted google query you 
>did to find the problem.  HTH!  ;-)

Yes, but that would be a logical thing to do and could ruin my
reputation for being a clutz. <g>

http://support.microsoft.com/kb/163653

Webbiz
0
Webbiz
3/17/2010 8:26:17 PM
On Wed, 17 Mar 2010 13:58:29 +0100, "Patrice"
<http://scribe-en.blogspot.com/> wrote:

>IMO you should stick to one method and debug this one. Have you tried to 
>check the return value for each and every call in your first code ? This is 
>where I would start...
>
>If not choosen yet :
>- With FTP, you'll have to configure your Linux server to be a ftp server 
>(seems to work as you create a directory (unless you created it earlier ;-))
>- With Http, you'll need your linux server to be a web server and have a 
>page that gets the uploaded content to save it on the server
>- Another option could be to expose your Linux filesystem as a network drive 
>(using perhaps something http://en.wikipedia.org/wiki/Samba_(software)). 
>Likely gives more admin work but then you'll just another drive.


Yes, it appears to be setup to handle FTP because that is how I upload
my files from my client when servicing my site.

I'll have to assume it is also a web server since my site is used to
display a complete website of pages. (or is this a bad assumption?).

I don't think I want to go the 'network drive' route. I clicked on
your link and it sends me to a page on a Brazillian dance. Okay, I'm
half brazillian, but I don't see how this dance is going to help. <g>

Thanks.

Webbiz
0
Webbiz
3/17/2010 8:34:04 PM
Webbiz wrote:
> On Wed, 17 Mar 2010 11:57:59 -0700, Karl E. Peterson <karl@exmvps.org>
> wrote:
>
> <more snipper-roo>
>
>> I'm sorry you took it wrongly. <snip>
>
> Karl, you and I certainly have a communications gap. I should add more
> smileys and <g>'s to my comments. 
>
>>> Sheesh Karl, what gives? First you start off being condensending with
>>> that F8-9 comment, then you slap me silly and call me Lucy. And to
>>> make it worse, you never used the control???
>
> "...then you slap me silly and call me Lucy." 
>
> I thought that line would have given it away that it's a
> tongue-n-cheek reply to some of your...eh...er... down level
> statements. <g> :-) LOL! ROTGLMAO! ;-b  (that should cover it).

Whoosh... <g>  I see Lucy, I think Linus' sister.

>> Have you tried comparing the TypeName's of the two objects?  Or do you 
>> just think VB is out to get you?  ;-)
>
> I definitely think that VB is out to get me. 

That has been shown, yeah. <g>

> Now that I am not sure how to do. How is that done? Seriously.

Ummm, Debug.Print TypeName(obj)

> If I declare a variable of type FUNGUS, and then try set the variable
> to a new object of FUNGUS.OBJECT, I'm a bit puzzled why this would not
> be the same type. Darn those MSDN people!
>
>  :-)

That .Object property often had some interesting surprises in store.

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 8:45:06 PM
Webbiz wrote:
> On Wed, 17 Mar 2010 12:00:13 -0700, Karl E. Peterson <karl@exmvps.org>
> wrote:
>
>> 
>> Webbiz wrote:
>>> This from a Microsoft MSDN page.
>>> 
>>> Any idea why "Set objFTP = Me!axFTP.Object" causes this error?
>> 
>> Btw, providing a link always encourages those curious to try recreating 
>> the error, without having to recreate whatever twisted google query you 
>> did to find the problem.  HTH!  ;-)
>
> Yes, but that would be a logical thing to do and could ruin my
> reputation for being a clutz. <g>
>
> http://support.microsoft.com/kb/163653

Okay, that actually helps.  This works:

   Private objInet As Inet

   Private Sub Form_Load()
      Set objInet = Inet1  '.Object
   End Sub

Nucking futz sample writers at MSFT never test a thing...

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/17/2010 8:50:55 PM
On Wed, 17 Mar 2010 13:45:06 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:


>
>Ummm, Debug.Print TypeName(obj)
>


Now that is useful information. <g>

I didn't know this was available. Cool Charlie Brown.

Thanks.

Webbiz
0
Webbiz
3/18/2010 3:50:28 AM
"Webbiz" <nospam@noway.com> wrote
> >
> >Ummm, Debug.Print TypeName(obj)
>
> Now that is useful information. <g>
>

Except that the returned string is "Inet",     ...Surprise!

With an Inet control on your form, type in "Inet1.object" and
press F1 for more info about the object property....

LFS



0
Larry
3/18/2010 11:46:25 AM
Ok so it  left you with using FTP or HTTP.

Have you tried to follow Karl's first advice that is to check the return 
value of each and every API call to find out which call fails...

Don'k now where you got your sample but 
http://support.microsoft.com/kb/195653/en-us seems to check return values 
quite often so perhaps a bit less straight to the point than needed..

--
Patrice
 


0
Patrice
3/18/2010 12:00:27 PM
On Thu, 18 Mar 2010 13:00:27 +0100, "Patrice"
<http://scribe-en.blogspot.com/> wrote:

>Ok so it  left you with using FTP or HTTP.
>
>Have you tried to follow Karl's first advice that is to check the return 
>value of each and every API call to find out which call fails...
>
>Don'k now where you got your sample but 
>http://support.microsoft.com/kb/195653/en-us seems to check return values 
>quite often so perhaps a bit less straight to the point than needed..


It wasn't API code, but the user of the Microsoft Internet Transfer
control. I posted the link on a recent post in this thread where MSDN
had an example and I followed it to my frustration.

:-)
Webbiz
0
Webbiz
3/18/2010 5:06:09 PM
Not sure at which point you are but if you still need help, you could 
perhaps choose a programming model once for all and open a new thread. The 
Wininet API would be likely better (not that hard and most flexibility).

Changing from the Win API to a control and then using an HTML upload makes 
helping impossible...

--
Patrice


"Webbiz" <nospam@noway.com> a �crit dans le message de groupe de discussion 
: 7an4q5hgsovtghbv2tkjo7tsg70ibml8tf@4ax.com...
> On Thu, 18 Mar 2010 13:00:27 +0100, "Patrice"
> <http://scribe-en.blogspot.com/> wrote:
>
>>Ok so it  left you with using FTP or HTTP.
>>
>>Have you tried to follow Karl's first advice that is to check the return
>>value of each and every API call to find out which call fails...
>>
>>Don'k now where you got your sample but
>>http://support.microsoft.com/kb/195653/en-us seems to check return values
>>quite often so perhaps a bit less straight to the point than needed..
>
>
> It wasn't API code, but the user of the Microsoft Internet Transfer
> control. I posted the link on a recent post in this thread where MSDN
> had an example and I followed it to my frustration.
>
> :-)
> Webbiz 


0
Patrice
3/18/2010 6:13:49 PM
Larry Serflaten wrote:
> "Webbiz" <nospam@noway.com> wrote
>>> 
>>> Ummm, Debug.Print TypeName(obj)
>> 
>> Now that is useful information. <g>
>
> Except that the returned string is "Inet",     ...Surprise!

Actually, it returns "Nothing", which was kinda the point. <eg>

> With an Inet control on your form, type in "Inet1.object" and
> press F1 for more info about the object property....

Yeah, Debug.Print TypeName(Inet1.Object) will indeed return "Inet", 
which makes the assignment all the more, uh, "interesting."

The thing to remember is Object isn't really a property of the object, 
but an Extender property to get at the object in cases where its 
properties conflict with other Extender properties.  I don't think it 
was ever intended to be used in the fashion suggested by this MSDN 
article, but I can't actually articulate why.  I suspect it's missing 
some sort of interface? <shrug>

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
3/18/2010 7:38:13 PM
Reply:

Similar Artilces:

DVD Copy Pro for Mac
[b]DVD Copy Pro for Mac[/b] is a DVD copy software that can support D9 to D5 compression. With simple operation, it can save DVD in four different ways including directly burning to DVD disc, saving as DVD folder, copying into DVD media format that can be played by DVD Player directly, and converting as ISO file for easy movie management. Now this cool Mac DVD Copy also supports the latest released Snow Leopard. You can download [b][url=http://www.dvd-copy-mac.net/download/dvd-copy-pro-mac.zip]DVD Copy Pro for Mac[/url][/b] freely right now. [b]More information:[/b][quote]http://www.dvd-...

Import/copy calendar in Outlook 2003
I got a new computer and installed Office 2003, and wanted to move my calendar to the new PC. I created a new data file called Personal Folders from Old PC. I wanted to copy my calendar OVER my current one in Personal Folders, but don't see a way to do so. I can copy my old calendar into the Pesonal Folders, but can't delete the new, empty Calendar. So I have Calendar, and Calendar 1 under my Personal Folders. Any way to just import/copy my reminders/appointments into my new calendar? Thanks for any advice. Ck G'Day Cathy, 1. Use the Folder List 2. Click on the OLD Cal...

Problems opening Excel files using DFS links
Hi, I origianlly posted this question under networking, but this may be a better forum for my question. Have a weird problem. We're on a Windows 2000 domain where the users' home directory has been redirected using this syntax: \\fqdn.xxx\dfs root\sharename\%username%. The DFS root server is a member file server that holds the majority of the network shares (including the user profiles and home folders). The DFS root is registered in our AD. Here's the problem: Occasionally someone will try to open an Excel file on a share via a DFS link and will get an error message stati...

Copy info from one workbook to another?
I have a problem I have a workbook with the function i want like a discribe here. The problem is i want to split the workbook but i don`t know how. Is it possible to have a main workbook with information from other workbooks at each worksheet? I have 20 workbooks with information. I would like to have a main workbook with on sheet1 every row from the 20workbooks with category1, on sheet2 every row from the 20workbooks with category2, etc, etc. The information in the 20workbooks in always only on sheet. The Colum in which the data is has no fix end. I go to fill in the rows trough a...

local copy of mail
How do you store a copy of all your mail on you local computer when using Exchange? You setup an OST/Offline Folders file. Check with your mail admin if they support that configuration. "Brandon Baker" <brandon@discussions.microsoft.com> wrote in message news:epNKuJ19FHA.4004@TK2MSFTNGP14.phx.gbl... > How do you store a copy of all your mail on you local computer when using > Exchange? > ...

Looking for a tool to repair corrupt excel sheet files
I am looking for a tool to repair corrupt excel sheet files. Any body knows? See also post http://groups.google.com/group/microsoft.public.excel/browse_thread/thread/dc040b0756273b62/9a108194fe01016e?lnk=st&q=aa+arens&rnum=1#9a108194fe01016e Bart Excel 2003 Hi Bart, Don't know how you corrupted your file, but from the description it seems you data is fine until you reenter data (F2+Enter would cause a reentry). If the sheet is really corrupt it would be more a matter of retrieving what data you can. From your description it sounds like someone selected all the cells on the ...

Secondary Copy
Hi, My customer using Great Plains modified report(Primary Copy). Now he wants new report something similar to the modified GP report with very few changes. I tried to copy the modified report and planned to use us a secondary copy. But the report has temp tables, so I am unable to make secondary copy. Can some one help me in how to make a new report something similar to the modified report, where to launch it. Whether it is possible throught VBA & Modifier? Regards Selvakumar.S A report with a temporary table can only be a primary copy. This is because only a primary copy can b...

PST file Size Limit #3
IS there a size limit for a PST data file in MS Outlook 2002 ? Thanks ! 2Gb "Zahid" <Zahid@discussions.microsoft.com> wrote in message news:88ED796B-D64A-4D1E-A866-90BE78A62456@microsoft.com... > IS there a size limit for a PST data file in MS Outlook 2002 ? Thanks ! "Zahid" <Zahid@discussions.microsoft.com> wrote in message news:88ED796B-D64A-4D1E-A866-90BE78A62456@microsoft.com... > IS there a size limit for a PST data file in MS Outlook 2002 ? Thanks ! 1.87GB (which is usually referred to as the 2GB limit). Vanguard <vanguard.code@comcast...

Outlook 2000 SP3
How can I copy my mail and calendar to CD so that I can take my received and sent mail history to a new computer with Outlook installed? Thanks. >-----Original Message----- >How can I copy my mail and calendar to CD so that I can >take my received and sent mail history to a new computer >with Outlook installed? Thanks. >. > All your data saves in C:\Documents and Settings\Username\Local Settings\Application Data\Microsoft\Outlook\archive.pst and C:\Documents and Settings\Evgeni\Local Settings\Application Data\Microsoft\Outlook\outlook.pst You can either install instan...

BMP file in OUTLOOK 2000
I used to be able to put a animated file in my Outlook2000 message. When a person received my message, the file would should up in the message. Now when I send the message, the file shows up as a attachment. Is their something else I need to do, or Out2000 change where you cannot do it anymore? Change your message format to HTML and choose Insert-> Picture to insert your gif-file -- Roady [MVP] www.howto-outlook.com Tips of the month: -Creating Signatures -Create an Office XP CD slipstreamed with Service Pack 3 ----- "bdowns" <bdowns@one.net> wrote in message new...

v10 Int Mgr settings for .ini file to see dyn windows being popula
In v8 and earlier I used to create a im.ini file that would open GP windows and show the integration running. How do you do this in v10? Thanks Ray Nist Ray, The setting hasn't change. [IMGPPrv] ShowDynamics=True Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC http://www.maximumglobalbusiness.com "Ray Nist" wrote: > In v8 and earlier I used to create a im.ini file that would open GP windows > and show the integration running. > > How do you do this in v10? > > Thanks > Ray Nist Thanks Mario. We set this and it ...

Copy picture ossice wizard
I have project 2007 standard edition, but the button is not working at all? Any suggestions Hi, The wizard is IMHO useless. Go to Roport, Copy Picture and do without the Wizard what millions have done before the Wizard existed. HTH -- Jan De Messemaeker Microsoft Project Most Valuable Professional +32 495 300 620 For availability check: http://users.online.be/prom-ade/Calendar.pdf "Enrique" <Enrique@discussions.microsoft.com> wrote in message news:72B5AA6C-67AE-468D-B6AE-FF16F52E57BD@microsoft.com... >I have project 2007 standard edition, but the bu...

Copy and paste versus copy and insert copied cells
What is the difference between these commands? Try them, it is pretty easy to see the difference -- Regards, Peo Sjoblom "Alana" <Alana@discussions.microsoft.com> wrote in message news:879FED29-5541-41B0-BB2C-7108D42ED593@microsoft.com... > What is the difference between these commands? ...

pdf file
When I try to open up a word pdf file in Microsoft Outlook Express I get a file conversion box. No matter what language or defalt setting I choose I still get symbols and numbers that make no sense. I have Word 2003. How can I make it readable? Try posting this in an Outlook Express news group - this is not one of them. Outlook is a part of Microsoft Office and is what this group supports. Outlook Express is a part of Internet Explorer and has its own news groups. You can also find some good Outlook Express information here: http://insideoe.tomsterdam.com --� Milly Staples [MVP - Ou...

Files with "xla" extentions
How to stop files with the "xla" from trying to load? After deleting the files Excel gives an error messeage when it can't find the file. Hi Tools>Add-ins Click on the Add-in and Excel will ask you if you want to delete it. -- Regards Ron de Bruin http://www.rondebruin.nl "thorviag" <thorviag@discussions.microsoft.com> wrote in message news:A6D742DD-D1DE-4B78-9BCD-F0138CB70E0B@microsoft.com... > How to stop files with the "xla" from trying to load? After deleting the > files Excel gives an error messeage when it can't find the file. ...

Outlook dbx file
My boss saved his outlook express messages to a file with a dbx extension on a memory stick off his old computer. How do I get outlook express to recognize the file on his new computer or restore it on his old one? He wants his messages back and I don't know how to open the dbx file and I can't seem to copy it back to it's original folder. Thanks. 1. Email Messages: From the Outlook Express menu select Tools | Options | Maintenance and click the StoreFolder button. You see a dialog with the name of the directory that has your mail files. If you look in that directory ...

subtotal copy and paste
Hi I have used the subtotal option in Excel and this is fine. I have also collasped the list so only the subtotal for each category is visible. However I want to copy and paste this list (just the subtotal) into another sheet When I do this it expands and shows all the results. Is it possible to just copy the visible bit. I have looked in paste special but no luck Cheers Hager On Jan 21, 6:38=A0am, Hager <Ha...@discussions.microsoft.com> wrote: > Hi > > I have used the subtotal option in Excel and this is fine. I have also > collasped the list so only the...

locked publisher 2002 file #2
I've a 12 user network running Publisher 2002 on Xp Pro PC's and a 2003 Server. When one user opens a document none of the others can open the same shared file on the network. It says that the file is locked because another program is using it. Can't find any reference to this message in the Knowledge Base or anywhere else. Don't have this problem with sharing Word or Excel files as these give the user the option to open the file read only, which is fine. Are there any reasons or restrictions in Publisher that may be causing this problem? As a work-around I can save th...

Copy above fails one way, copy below fails another way
I have a table of blood pressure readings that looks something like this: A B C D E 11 12 Averages: 134 83 74 13 R# Date Sys Dia Pul 14 4 8/17/08 138 87 72 15 3 8/15/08 130 84 76 16 2 8/12/08 137 83 70 17 1 8/11/08 129 79 76 Cell A14 contains =A15+1 Cell C12 contains =AVERAGE(C14:C17) Cell D12 contains =AVERAGE(D14:D17) Cell E12 contains =AVERAGE(E14:E17) Every time I take a new reading, I want to add a row to the top of the table, between row 13 (the header) and row 14 (the previous top row). I want to push a...

Business Portal "Copy to Excel" not working in Query pages
Hi, I am using Business Portal 4.0. When browsing through one of the queries pages in Business Portal, i clicked "Copy to Excel" icon. I got an error saying "The Office Web Components (OWC) must be installed to copy results to Excel." at the bottom. I am using Office 2007 on my machine. I came to know that Microsoft Office Web Components will no longer be shipping in Microsoft Office. I tried installing Office 2003 Add-in: Office Web Components from http://www.microsoft.com/downloads/details.aspx?familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en a...

Backup mail server (One domain, two mail servers)
Hey there I setup exchange to receive mail for 2 domains. Its working fine. As a contingency plan i want to setup a scenario in which even if my mail server aint available i shouldnt have LOST MAIL/ BOUNCED MAIL issues. I studied a few possibilities including clustering but that aint applicable to our scenario. The possibility applicable is the presence of 2 mail servers on the same domain. If my primary mail server is not available for some reason, my second machine takes over. I know thats possible but HOW? Can someone guide me to the implementation. At the moment, i have one machine servic...

Copying graphs
Hi Is it possible to range value a graph ie I would like to copy the graph to another workbook, show all the information but without the links? Thanks You could copy the chart as a picture, then paste it wherever you want. Select the chart, hold Shift while clicking on the Edit menu, Choose Copy Picture, and select the On Screen and As Picture options, then go to the other workbook/sheet and Paste. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Dixie" <Dixie@discussions.micr...

Saving a .PST file
Some time ago didn't Microsoft release a free add-in for O2003 to periodically copy the .PST file to a backup location? I can't find it on Office Download. Does anyone know where it is? Many thanks. Outlook 2003 Add-in: Personal Folders Backup http://www.microsoft.com/downloads/details.aspx?familyid=8b081f3a-b7d0-4b16-b8af-5a6322f4fd01&displaylang=en "Andrew Chalk" <achalk@magnacartasoftware.com> wrote in message news:%23tNSQKahFHA.1244@TK2MSFTNGP14.phx.gbl... > Some time ago didn't Microsoft release a free add-in for O2003 to > periodically copy ...

Exporting Exchange Mailboxes To The File System
Hi all, Not the best forum to ask for an Exchange issue, but it is in relation to a Lotus Notes migration and hopefully others may come across this issue. We are in the process of migrating an Exchange environment to Lotus Notes. Company policy dictates emails older than 60-days are deleted in Lotus Notes (application executes this). The exchange environment has years of email history and therefore we have compromised to look at a solution to export ALL their Exchange mailboxes/emails onto the file system (local drives). Exporting to PST is not allowed since this violates the company poli...

Copying Views
Is there any way to copy the views under leads so that i can modify them and create different ones. I need to create 15 views and i do not want to do all of them one at a time. Even if there is a way to do it in sql i would love to know -- IT Manager It can be done in SQL, though it's unsupported. What you want need to do is use INSERT ... SELECT to copy rows in the savedquerybase, and give a different savedqueryid For a supported route you can use the CRM web service and create new instances of savedquery. The following article describes how to do this for the userquery, and coul...