I am trying to do authentication of a user using ftp. I have found in the cmd line that for cmd /k ftp -s:" & strPath the code 230 = Logged in and 530 = failed. I want to read these results and grant permission to my database based on either of these numbers.
I need to figure out how to write the shell results to a variable or txt file. Preferably a variable in msaccess.
If Not IsNull(Me.PWD) And Not IsNull(Me.CDSID) Then
' Write to ftp.txt
Dim strFTP As String, strPath As String
strFTP = "open xxxxxxxx.xx.xxxxx.com" & vbCrLf & _
"yyyyyy/" & Me.CDSID & vbCrLf & _
Me.PWD & vbCrLf & _
strPath = "C:\WINDOWS\Temp\ftp.txt
Open strPath For Output As #1
Print #1, strFTP
' Execute ftp.txt
Shell ("cmd /k ftp -s:" & strPath)
' Write to variable
>>>This is the part in question!!!
' Look for 230(logged in) or 530(failed)
' Delete ftp.txt