Error 17 on Connect after applying license

We have recently acquired SmartFtp Library license and applied it using the example VBS as a template. License VBS appeared to run correctly. However my SmartFtp VBS scripts are getting error 17 when invoking the connect method.

Can you offer a fix for this?

Thanks
Peter Dunphy



License VBS:


'///////////////////////////////////////////////////////////////////////////////////
'//
'// LoadLicenseKeyData v1.0 (9. May 2005)
'//
'// Purpose:
'// Shows how to load the license key from a string.
'//
'// Copyright

Hello ..

The script returns "Success" for me as well.

Do you call the LoadLicenseKeyFile or LoadLicenseKeyData before you call the Connect function?
Please post the script where the Connect() calls returns 17.
Do you have latest version of the FTP Library installed?

BTW: Please do not post your complete license key.

Regards,
-Mat

Hello ..

The script returns "Success" for me as well.

Do you call the LoadLicenseKeyFile or LoadLicenseKeyData before you call the Connect function?
Please post the script where the Connect() calls returns 17.
Do you have latest version of the FTP Library installed?

BTW: Please do not post your complete license key.

Regards,
-Mat


Mat,

I do not call LoadLicenseKeyData before I call Connect. I assumed the license info was loaded into the registry or some other permanent store. Is this not the case?

Below is my script that fails.

If I call the License method prior to the connect method will it work?
This script was working using the 30 day aval license.

Peter

Connect Script:
'///////////////////////////////////////////////////////////////////////////////////
'//
'// 2007 © Unisys Marysville Data Centre
'//
'// Purpose:
'// Connects to remote DPS server.
'//
'//
'//
'///////////////////////////////////////////////////////////////////////////////////
Dim obj
Set obj = CreateObject("sfFTPLib.FTPConnectionSTA")

' "Object created." & vbCrLf

set shell = WScript.CreateObject( "WScript.Shell" )
datafile = shell.ExpandEnvironmentStrings("%DATAFILE%")
filename = shell.ExpandEnvironmentStrings("%FILENAME%")
appgrp= shell.ExpandEnvironmentStrings("%APPGRP%")


Dim fso, tf

Set fso = CreateObject("Scripting.FileSystemObject")

Set tf = fso.CreateTextFile("FtpLogtxt.txt", True)


tf.WriteLine("Begin vbs.")




Dim result

tf.WriteLine( " pcfile=" & datafile & ", destfilename=" & filename & ", appgrp=" & appgrp )


' Settings
If "PROD" = appgrp Then
obj.Host = "142.139.*.*"
obj.Username = "****"
obj.Password = "*****"
path= "/MV/Diesel"
Else
obj.Host = "142.139.*.*"
obj.Username = "****"
obj.Password = "*****"
path = "/mv/unisys"
End if

obj.Port = 21
obj.Protocol = 2 ' 2 = ftpProtocolSSLExplicit
obj.Passive = 0 ' DPS says no Passive
obj.MLST = 1
' Enable logging
obj.LogFile = "Connect.log"


tf.WriteLine( "Port = " & obj.Port & vbCrLf )

' Connect
result = obj.Connect()


tf.WriteLine("Connected. result=" & result & vbCrLf )

If result <> 0 Then
strMsg = "connect failed. " & "LastReplyCode = " & obj.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & obj.LastReply & vbCrLf
tf.WriteLine( strMsg )

End If



If obj.ChangeDirectory( path ) = 0 Then
tf.WriteLine("ChangeDirectory() successful.")

' Upload File
Dim nRestartLo : nRestartLo = 0
Dim nRestartHi : nRestartHi = 0

Dim strMsg
If obj.UploadFile(datafile, filename, nRestartLo, nRestartHi) = 0 Then
strMsg = "UploadFile() successful." & vbCrLf
strMsg = strMsg & "LastTransferBytes = " & obj.LastTransferBytesLo & " B" & vbCrLf
strMsg = strMsg & "LastTransferTime = " & obj.LastTransferTime & " s" & vbCrLf
strMsg = strMsg & "LastTransferSpeed = " & obj.LastTransferSpeed & " B/s"
tf.WriteLine( strMsg )
Else

strMsg = "UploadFile() failed. LastError = " & obj.LastError & vbCrLf
strMsg = strMsg & "LastReplyCode = " & obj.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & obj.LastReply & vbCrLf
tf.WriteLine( strMsg )
End If
Else
strMsg = "CD failed. " & "LastReplyCode = " & obj.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & obj.LastReply & vbCrLf
tf.WriteLine( strMsg )
End If
tf.Close

Ok I am now past the license issue via embedding the License mthod call into my main script.

Does this License tag/token only exist in memory of the Smart FTP DLL?

Peter

Hello ..

Yes you must call the LoadLicenseKeyData method before you call any other function. However it's only necessary to call it once per process.

Regards,
-Mat