473,320 Members | 1,921 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,320 software developers and data experts.

Dart PowerFTP File Transfer Error

Hello Gurus

I can't get Dart PowerFTP to do anything. I create the
ftp oblect and set the connection values, but when I do a
get, put or even an invoke for a site command, I always
get the error message "No more results can be returned by
WSALookupServiceNext."

If anyone could give me some advice either about this
problem or where to ask this question, I would apreciate
it.

Here is the code I am using
Public Function TransferFiles() As Boolean
Dim DartFTP As New Dart.PowerTCP.Ftp.Ftp()
Dim StartTime, EndTime, NetTime As Double
Dim DartFTPResults As FtpFile
Dim intBytes As Integer
dim strHostName, strUsername, strPassword As String

strHostName = "ISTPFTP.STATE.WI.US"
strUsername = "JX9256"
strPassword = "CRESTEST"

Dim strErrorMsg, strSiteCommand As String

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("NOW TRANSFER THE FILES")

Try
'set connection values
With DartFTP
DartFTP.Server = strHostName.ToString
DartFTP.Username = strUserName.ToString
DartFTP.Password = strPassword.ToString
DartFTP.Passive = False
End With
blnTransferAborted = False
StartTime = Now.Ticks

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("Connection values set")
swrXferLog.WriteLine(" Server=" &
DartFTP.Server)
swrXferLog.WriteLine(" Username=" &
DartFTP.Username)
swrXferLog.WriteLine(" Password=" &
DartFTP.Password)
swrXferLog.WriteLine(" ")
Dim fRec As New sFileRec()
Dim strMF1, strPC1, strDCB1, strDir1 As String
Dim intSub As Integer
For intSub = 1 To intFileCount
fRec = FileArray(intSub - 1)
strMF1 = "'" & fRec.MFfilename & "'"
strPC1 = fRec.PCfilename
strDCB1 = fRec.DCBinfo
strDir1 = fRec.UpOrDown
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" File " &
intSub.ToString)
swrXferLog.WriteLine(" MF: " & strMF1)
swrXferLog.WriteLine(" PC: " & strPC1)

If strDir1 = "Upload" Then
strSiteCommand = FormatSiteCommand
(strDCB1)
swrXferLog.WriteLine(" DCB: " &
strSiteCommand)
swrXferLog.WriteLine(" ")
'DartFTP.Invoke
(FtpCommand.SiteParameters, strSiteCommand)
'DartFTPResults = DartFTP.Put(strMF1,
strPC1)
swrXferLog.WriteLine("Upload file #" &
intSub.ToString)
swrXferLog.WriteLine(" From " &
strPC1)
swrXferLog.WriteLine(" To " &
strMF1)
swrXferLog.WriteLine(" DCB " &
strSiteCommand)
Else
DartFTPResults = DartFTP.Get(strMF1,
strPC1)
'DartFTP.Get(strMF1, strPC1)
swrXferLog.WriteLine("Download file #"
& intSub.ToString)
swrXferLog.WriteLine(" From " &
strMF1)
swrXferLog.WriteLine(" To " &
strPC1)
swrXferLog.WriteLine(" From " &
DartFTPResults.RemoteFileName)
swrXferLog.WriteLine(" To " &
DartFTPResults.LocalFileName)
swrXferLog.WriteLine(" Bytes " &
DartFTPResults.Count)
End If

Next

EndTime = Now.Ticks
NetTime = (EndTime - StartTime) / 10000000
Catch ex As Exception
swrXferLog.WriteLine(" ")
strErrorMsg = ex.Message
swrXferLog.WriteLine(" ErrorMsg: " &
strErrorMsg)
strErrorMsg = ex.Source
swrXferLog.WriteLine(" ErrorSrc: " &
strErrorMsg)
blnTransferAborted = True
End Try

If DartFTP.Connected Then
DartFTP.Close()
End If

Dim strNow As String
swrXferLog.WriteLine(" ")
strNow = Now.ToString("MM/dd/yy hh:mm:ss")
If blnTransferAborted Then
swrXferLog.WriteLine(strNow & " Error: " &
strErrorMsg)
Else
swrXferLog.WriteLine(strNow & " File
transfer completed successfully")
End If
swrXferLog.Close()
Return Not blnTransferAborted

End Function
Jul 21 '05 #1
1 3651
That's a Winsock Error, not necessarily related to Dart.
http://groups.yahoo.com/group/vcpphe.../7606?source=1

http://msdn.microsoft.com/library/de...vicenext_2.asp
I use Dart and it's always been very reliable... There are a lot of risky
operations in your code (risky being defined as things can go wrong that
aren't your code's fault. ) Which line is it failing on? Can you Put to
the server?
Here's a typical snippet I use...(I have the permission properties set
already) However, try catching the specific Dart Exceptions instead of
System.Exception, it should give you a hint to what's happening.

Try

Dim fp As FtpFile = Ftp1.Put(s, Me.Path & shortName)

If File.Exists(modMain.ArchiveDirectory & shortName) Then

File.Delete(modMain.ArchiveDirectory & shortName)

End If

If File.Exists(s) Then File.Move(s, modMain.ArchiveDirectory & shortName)

Me.LogTransmission(modMain.ArchiveDirectory & shortName, 1)

Catch ex As Dart.PowerTCP.SecureFtp.ProtocolException ' or you coud trap
busy

Debug.WriteLine("SecureFTP Exception: " & ex.ToString)

Me.LogTransmission(modMain.ArchiveDirectory & shortName, 0)

Finally

Ftp1.Close()

End Try

"Eric Cory" <er*******@dwd.state.wi.us> wrote in message
news:45****************************@phx.gbl...
Hello Gurus

I can't get Dart PowerFTP to do anything. I create the
ftp oblect and set the connection values, but when I do a
get, put or even an invoke for a site command, I always
get the error message "No more results can be returned by
WSALookupServiceNext."

If anyone could give me some advice either about this
problem or where to ask this question, I would apreciate
it.

Here is the code I am using
Public Function TransferFiles() As Boolean
Dim DartFTP As New Dart.PowerTCP.Ftp.Ftp()
Dim StartTime, EndTime, NetTime As Double
Dim DartFTPResults As FtpFile
Dim intBytes As Integer
dim strHostName, strUsername, strPassword As String

strHostName = "ISTPFTP.STATE.WI.US"
strUsername = "JX9256"
strPassword = "CRESTEST"

Dim strErrorMsg, strSiteCommand As String

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("NOW TRANSFER THE FILES")

Try
'set connection values
With DartFTP
DartFTP.Server = strHostName.ToString
DartFTP.Username = strUserName.ToString
DartFTP.Password = strPassword.ToString
DartFTP.Passive = False
End With
blnTransferAborted = False
StartTime = Now.Ticks

swrXferLog.WriteLine(" ")
swrXferLog.WriteLine("Connection values set")
swrXferLog.WriteLine(" Server=" &
DartFTP.Server)
swrXferLog.WriteLine(" Username=" &
DartFTP.Username)
swrXferLog.WriteLine(" Password=" &
DartFTP.Password)
swrXferLog.WriteLine(" ")
Dim fRec As New sFileRec()
Dim strMF1, strPC1, strDCB1, strDir1 As String
Dim intSub As Integer
For intSub = 1 To intFileCount
fRec = FileArray(intSub - 1)
strMF1 = "'" & fRec.MFfilename & "'"
strPC1 = fRec.PCfilename
strDCB1 = fRec.DCBinfo
strDir1 = fRec.UpOrDown
swrXferLog.WriteLine(" ")
swrXferLog.WriteLine(" File " &
intSub.ToString)
swrXferLog.WriteLine(" MF: " & strMF1)
swrXferLog.WriteLine(" PC: " & strPC1)

If strDir1 = "Upload" Then
strSiteCommand = FormatSiteCommand
(strDCB1)
swrXferLog.WriteLine(" DCB: " &
strSiteCommand)
swrXferLog.WriteLine(" ")
'DartFTP.Invoke
(FtpCommand.SiteParameters, strSiteCommand)
'DartFTPResults = DartFTP.Put(strMF1,
strPC1)
swrXferLog.WriteLine("Upload file #" &
intSub.ToString)
swrXferLog.WriteLine(" From " &
strPC1)
swrXferLog.WriteLine(" To " &
strMF1)
swrXferLog.WriteLine(" DCB " &
strSiteCommand)
Else
DartFTPResults = DartFTP.Get(strMF1,
strPC1)
'DartFTP.Get(strMF1, strPC1)
swrXferLog.WriteLine("Download file #"
& intSub.ToString)
swrXferLog.WriteLine(" From " &
strMF1)
swrXferLog.WriteLine(" To " &
strPC1)
swrXferLog.WriteLine(" From " &
DartFTPResults.RemoteFileName)
swrXferLog.WriteLine(" To " &
DartFTPResults.LocalFileName)
swrXferLog.WriteLine(" Bytes " &
DartFTPResults.Count)
End If

Next

EndTime = Now.Ticks
NetTime = (EndTime - StartTime) / 10000000
Catch ex As Exception
swrXferLog.WriteLine(" ")
strErrorMsg = ex.Message
swrXferLog.WriteLine(" ErrorMsg: " &
strErrorMsg)
strErrorMsg = ex.Source
swrXferLog.WriteLine(" ErrorSrc: " &
strErrorMsg)
blnTransferAborted = True
End Try

If DartFTP.Connected Then
DartFTP.Close()
End If

Dim strNow As String
swrXferLog.WriteLine(" ")
strNow = Now.ToString("MM/dd/yy hh:mm:ss")
If blnTransferAborted Then
swrXferLog.WriteLine(strNow & " Error: " &
strErrorMsg)
Else
swrXferLog.WriteLine(strNow & " File
transfer completed successfully")
End If
swrXferLog.Close()
Return Not blnTransferAborted

End Function

Jul 21 '05 #2

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

Similar topics

6
by: clintonG | last post by:
After the last six days trying to download VS2005 Professional it seems there may be a problem with my instance of the File Transfer Manager (FTM) or somewhere in the network in between. I can't...
8
by: Xarky | last post by:
Hi, I am downloading a GIF file(as a mail attachement) with this file format, Content-Transfer-Encoding: base64; Now I am writing the downloaded data to a file with this technique: ...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
1
by: Irfan Akram | last post by:
Hey where can I get the library Dart.PowerWEB.LiveControls from ? Thanks, I.A "Jeff @ Dart" wrote: > If you are considering commercial solutions, check this.... >
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: Eric Cory | last post by:
Hello Gurus I can't get Dart PowerFTP to do anything. I create the ftp oblect and set the connection values, but when I do a get, put or even an invoke for a site command, I always get the...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
6
by: half.italian | last post by:
Hi all, I'm using ftplib to transfer large files to remote sites. The process seems to work perfectly with small files, but when the file gets to large ~20GB I begin getting errors that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.