I finally found a method to ftp that works without using sendkeys or shells to do ftp. It's from here:
http://www.mvps.org/access/modules/mdl0037.htm
Here is the stock code segment including the CLASS object URL_COMPONENTS and the function that breaks it.
My workaround is to comment out the error checking in this, bypassing basically everything it does and add these lines near the end.
tURLInfo.lpszHostName = "csxtsysb.csxt.csx.com"
tURLInfo.lpszPassword = "actual_password"
tURLInfo.lpszUrlPath = "'FLRSFCP.FOC.DSK15Q.DATA'"
tURLInfo.lpszUserName = "actual_login"
tURLInfo.lpszScheme = 0
fParseURL = True
Adding these lines makes it work. I think the problem is that I do not understand what the function does completely and how it’s supposed to extract the values. I’m not sending the right data into the Buffer?
I'm looking for any input I can get. While I can obviously get this working by modifying/bypassing this functionality - I'd rather see if I can get it working AND possibly learning something. I know I avoid commenting when I'm not sure on something - so please feel free to send a direct message if you don't wish to post to the forum.
Mike
http://www.mvps.org/access/modules/mdl0037.htm
Here is the stock code segment including the CLASS object URL_COMPONENTS and the function that breaks it.
Rich (BB code):
Option Compare Database
Option Explicit
'
' Copyright (C)1998-99 Dev Ashish and Terry Kreft, All Rights Reserved
' The Access Web (http://home.att.net/~dashish)
' Comments and bug reports can be emailed to us
' Dev Ashish (dash10@hotmail.com) ; Terry Kreft (terry.kreft@mps.co.uk)
'
'
Private Type URL_COMPONENTS
dwStructSize As Long
lpszScheme As String
dwSchemeLength As Long
nScheme As Long
lpszHostName As String
dwHostNameLength As Long
nPort As Long
lpszUserName As String
dwUserNameLength As Long
lpszPassword As String
dwPasswordLength As Long
lpszUrlPath As String
dwUrlPathLength As Long
lpszExtraInfo As String
dwExtraInfoLength As Long
End Type
Private mstrURL As String
Private mstrDestination As String
Private mblnConnectState As Boolean
Private mblnOverWrite As Boolean
Private hFile As Long
Private hSession As Long
Private lnghWnd As Long
Private hInet As Long
Private hFTP As Long
Private hURL As Long
Private mlngSize As Long
Private mblnPromptForFile As Boolean
Private mtURLInfo As URL_COMPONENTS
Private mcolRemoteDir As Collection
Private mstrSrcFile As String
Private mblnUpload As Boolean
Private mblnUseProxy As Boolean
Private mblnCreateRemoteDir As Boolean
Private mintErrorTrap As Integer
Private Function fParseURL(tURLInfo As URL_COMPONENTS, ByVal strURL As String) As Boolean
Dim lngLen As Long, strBuffer As String
Dim lngRet As Long, strURLLocal As String
strBuffer = String$(MAX_BUFFER, 0)
lngLen = Len(strBuffer)
lngRet = apiInetCanonicalizeUrl(strURL, strBuffer, lngLen, ICU_BROWSER_MODE)
If Not lngRet = 0 Then
strURLLocal = Left$(strBuffer, lngLen)
With tURLInfo
.lpszScheme = String$(MAX_BUFFER, 0)
.dwSchemeLength = MAX_BUFFER
.nScheme = INTERNET_SCHEME_UNKNOWN
.lpszHostName = String$(MAX_BUFFER, 0)
.dwHostNameLength = MAX_BUFFER
.dwStructSize = Len(tURLInfo)
.nPort = 0
.lpszUserName = String$(MAX_BUFFER, 0)
.dwUserNameLength = MAX_BUFFER
.lpszPassword = String$(MAX_BUFFER, 0)
.dwPasswordLength = MAX_BUFFER
.lpszUrlPath = String$(MAX_BUFFER, 0)
.dwUrlPathLength = MAX_BUFFER
.lpszExtraInfo = String$(MAX_BUFFER, 0)
.dwExtraInfoLength = MAX_BUFFER
End With
lngRet = apiInetCrackUrl(strURLLocal, Len(strURLLocal), _
ICU_ESCAPE, tURLInfo)
If lngRet = 0 Then
fParseURL = False
Else
fParseURL = True
With tURLInfo
.lpszExtraInfo = fTrimNull(.lpszExtraInfo)
.lpszHostName = fTrimNull(.lpszHostName)
.lpszPassword = fTrimNull(.lpszPassword)
.lpszScheme = fTrimNull(.lpszScheme)
.lpszUrlPath = fTrimNull(.lpszUrlPath)
.lpszUserName = fTrimNull(.lpszUserName)
End With
End If
End If
End Function
My workaround is to comment out the error checking in this, bypassing basically everything it does and add these lines near the end.
tURLInfo.lpszHostName = "csxtsysb.csxt.csx.com"
tURLInfo.lpszPassword = "actual_password"
tURLInfo.lpszUrlPath = "'FLRSFCP.FOC.DSK15Q.DATA'"
tURLInfo.lpszUserName = "actual_login"
tURLInfo.lpszScheme = 0
fParseURL = True
Adding these lines makes it work. I think the problem is that I do not understand what the function does completely and how it’s supposed to extract the values. I’m not sending the right data into the Buffer?
I'm looking for any input I can get. While I can obviously get this working by modifying/bypassing this functionality - I'd rather see if I can get it working AND possibly learning something. I know I avoid commenting when I'm not sure on something - so please feel free to send a direct message if you don't wish to post to the forum.
Mike