access 97: ftp code problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JMCN

    #1

    access 97: ftp code problems

    i have been running into some ftp problems. when i run the ftp, the
    log indicates that it has been ftp'd.
    here is my ftp log:

    USER XX
    PASS XXX
    CONNECT XXX.dns.com
    CD $1$DKB101:[USBCERT_REPORTS]
    GET PROD6-06-09-04-299-2 C:\TEMP\PROD.tx t 0
    CD $1$DKA101:[USBMABS_REPORTS]
    GET PROD6-06-09-04-299-2 C:\TEMP\PRODUSB MABS.txt 0

    however i look in the c:\temp directory and cannot find the two files.
    can anyone tell me what is wrong
    with the below code and why it does not ftp to the c:\temp directory?
    the Forms![frmFTPData]![txtDatabase] and
    Forms![frmFTPData]![txtReportName] needs to have a value. if it
    does not have values, then it should exit out of the if statement. the
    [txtDatabase] is important because
    it tells which report is from which database name.

    thanks in advance- jung.

    If Forms![frmFTPData]![txtDatabase] <> "" And
    Forms![frmFTPData]![txtReportName] <> "" Then
    strSQL = "INSERT INTO [tblFTPText] ( [Text String] ) SELECT 'CD
    $1$DKB101:[USBCERT_REPORTS]' AS Expr1;"
    Set qdf = db.CreateQueryD ef("", strSQL)
    qdf.Execute
    'Insert Name of file to retrieve and name and location to save as
    strSQL = "INSERT INTO [tblFTPText] ( [Text String] ) SELECT 'GET "
    & Forms![frmFTPData]![txtReportName].Value & " " &
    Forms![frmFTPData]![txtSavedDataLoc ation].Value & "PROD.txt 0'"
    strSQL = strSQL & " AS Expr1;"
    Set qdf = db.CreateQueryD ef("", strSQL)
    qdf.Execute
    End If

    If Forms![frmFTPData]![txtDatabase] <> "" And
    Forms![frmFTPData]![txtReportName] <> "" Then
    strSQL = "INSERT INTO [tblFTPText] ( [Text String] ) SELECT 'CD
    $1$DKA101:[USBMABS_REPORTS]' AS Expr1;"
    Set qdf = db.CreateQueryD ef("", strSQL)
    qdf.Execute
    'Insert Name of file to retrieve and name and location to save as
    strSQL = "INSERT INTO [tblFTPText] ( [Text String] ) SELECT 'GET "
    & Forms![frmFTPData]![txtReportName].Value & " " &
    Forms![frmFTPData]![txtSavedDataLoc ation].Value & "PRODUSBMABS.tx t 0'"
    strSQL = strSQL & " AS Expr1;"
    Set qdf = db.CreateQueryD ef("", strSQL)
    qdf.Execute
    End If

    'copy script file to ftp directory
    DoCmd.TransferT ext acExportDelim, "myftp", "tblFTPText ",
    "c:\temp\bmftp. txt", False, ""

    'ftp files
    Call ShellWait("C:\b m_ref\ftpbm.bat ", 1)
    'C:\PROGRA~1\WS _FTP~1\FTPSCRPT c:\temp\bmftp.t xt
Working...