473,394 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

??? for Wayne Gillespie on FTPClient Class Module.


Well Wayne, I have made very good use of your excellent FTP class
module. There is only one remaining problem: Despite the fact that
you defined FTP error codes in FTPClient, I cannot seem to get the
errors to trigger when they should (for example, "No Internet
connection", or "Invalid login", etc.) Do I need to Raise these
error's myself? If so, how will I know if they have happened (from
VBA code that is)?

To test the most basic error possibilities, I deliberately used an
invalid login. No error was triggered.

What am I missing?

Thanks for your help. Happy New Year!

--LW
Jan 1 '06 #1
1 1778
On Sun, 01 Jan 2006 12:53:48 -0600, Lauren Wilson <no****@none.com> wrote:

Well Wayne, I have made very good use of your excellent FTP class
module. There is only one remaining problem: Despite the fact that
you defined FTP error codes in FTPClient, I cannot seem to get the
errors to trigger when they should (for example, "No Internet
connection", or "Invalid login", etc.) Do I need to Raise these
error's myself? If so, how will I know if they have happened (from
VBA code that is)?

To test the most basic error possibilities, I deliberately used an
invalid login. No error was triggered.

What am I missing?

Thanks for your help. Happy New Year!

--LW


Check that the RaiseError lines have not been remmed out and replaced by setting a public variable as in the following
extract. I took the code from a project I did 3 or 4 years ago and can't rememeber why I did it this way, but there was
a reason :)

Un rem the line -
If m_hCon = 0 Then RaiseError errOpenCon
And rem out the If statement that follows this line.

Public Sub OpenServer(Optional pServerName, Optional pUserName, Optional pPassword)
'Establish connection to server

'If FTP session not initiated
If m_hFTP = 0 Then RaiseError errNotOpen
'
'Handle optional parameters
If Not IsMissing(pServerName) Then m_ServerName = pServerName
If Not IsMissing(pUserName) Then m_UserName = pUserName
If Not IsMissing(pPassword) Then m_Password = pPassword
'
'Handle empty properties
If Len(m_ServerName) = 0 Then RaiseError errNoServer
'
'The following are translated to:
' UserName: Anonymous
' Password: default email address
'by the API, if nulls passed
If Len(m_UserName) = 0 Then m_UserName = vbNullString
If Len(m_Password) = 0 Then m_Password = vbNullString
'
m_hCon = InternetConnect(m_hFTP, m_ServerName, INTERNET_INVALID_PORT_NUMBER, _
m_UserName, m_Password, INTERNET_SERVICE_FTP, _
INTERNET_FLAG_PASSIVE, 0)
'If m_hCon = 0 Then RaiseError errOpenCon <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,
If m_hCon = 0 Then
booIsConnected = False
Exit Sub
Else
booIsConnected = True
End If
End Sub

Wayne Gillespie
Gosford NSW Australia
Jan 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Edvard Majakari | last post by:
Hi, I just found py.test and converted a large unit test module to py.test format (which is actually almost-no-format-at-all, but I won't get there now). Having 348 test cases in the module and...
2
by: Reid Priedhorsky | last post by:
Dear group, I'd have a class defined in one module, which descends from another class defined in a different module. I'd like the superclass to be able to access objects defined in the first...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
10
by: Bonzol | last post by:
vb.net Hey there, could someone just tell me what the differnce is between classes and modules and when each one would be used compared to the other? Any help would be great Thanx in...
32
by: Matias Jansson | last post by:
I come from a background of Java and C# where it is common practise to have one class per file in the file/project structure. As I have understood it, it is more common practice to have many...
6
by: JonathanOrlev | last post by:
Hello everyone, I have a newbe question: In Access (2003) VBA, what is the difference between a Module and a Class Module in the VBA development environment? If I remember correctly, new...
13
by: André | last post by:
Hi, i'm developping asp.net applications and therefore i use VB.net. I have some questions about best practises. According what i read about class and module and if i understand it right, a...
3
by: Jeffrey Barish | last post by:
I have a class derived from string that is used in a pickle. In the new version of my program, I moved the module containing the definition of the class. Now the unpickle fails because it doesn't...
3
by: dynamo08 | last post by:
Hi, I am new to socket programming, I wrote an ftpclient which connects to an ftp server and downloads a file to the client computer. Now in one client connection I want to download multiple files...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.