|
Hi, you can do that in two ways: - the first is by ftp command but it's too complicated - the easy way it's using Client Access DLL (you must include it in your project's reference)... like that: Public Function lanRmtPGM(curr_strRMTCMD) On Error GoTo lanRmtPGM_ERR ' Variabili relative al lancio del comando remoto sincrono su AS/400 Dim rc As Long Dim mySystem As Object Dim myRmtCmd As Object Dim errorObject As Object Dim systemName As String Dim stringRmtCmd As String Dim errorcount As Long Dim errorText As String Dim X As Long Dim timestamp As String DoEvents 'Definisco i parametri per l'esecuzione dei comandi remoti sincroni su AS/400 Set mySystem = CreateObject("cwbremotecallconversation") Set myRmtCmd = CreateObject("cwbCommand") Set errorObject = CreateObject("cwberrormessage") 'Inizializzo il flag di errore remoto rmtErrore = 0 'Effettuo la chiamata alla API di lancio comando remoto sincrono su AS/400 Call errorObject.cwbsvSetup rc = mySystem.cwbrcStartConversation(INI_strNetaAS400, "") If (rc <> cwbOK) Then '************ errorcount = errorObject.errorcount If (errorcount <> 0) Then For X = 1 To errorcount Call errorObject.cwbsvGetErrTextIndexed(X, errorText) MsgBox (errorText) Next X Else MsgBox (rc) End If '************ 'Accendo il flag di errore remoto rmtErrore = 1 Else stringRmtCmd = "CALL " & curr_strRMTCMD rc = myRmtCmd.cwbrcRunCmd(mySystem, stringRmtCmd, errorObject) If (rc <> cwbOK) Then '************ errorcount = errorObject.errorcount If (errorcount <> 0) Then For X = 1 To errorcount Call errorObject.cwbsvGetErrTextIndexed(X, errorText) MsgBox (errorText) Next X Else MsgBox (rc) End If '************ 'Accendo il flag di errore remoto rmtErrore = 1 End If End If DoEvents Exit Function lanRmtPGM_ERR: 'Mando a video la descrizione dell'errore accaduto MsgBox ("lanPmtPGM" & ": " & Err.Err.Number & "-" & Err.Description) ' Imposto il messaggio di stato frmSplash.TxtStato = "E' intercorso un errore nel lancio comando remoto su AS/400, verificare!" frmSplash.Refresh Sleep (250) rmtErrore = 1 Exit Function End Function I hope that can help you. Fabrizio Gurrieri - BARTOLINI SPA Via E.Mattei 42 - 40138 BOLOGNA (Italy) Tel:+39 051 6015593 - Fax:+39 051 530365 E-Mail: Fabrizio.Gurrieri@xxxxxxxxxxxx Internet: http://www.bartolini.it -----Messaggio originale----- Da: pedro.reis@xxxxxxxxx [mailto:pedro.reis@xxxxxxxxx] Inviato: venerdì 16 maggio 2003 10.45 A: midrange-l@xxxxxxxxxxxx Oggetto: calling as400 command from VBA Hi, I would like to call a as400 from VBA, does anyone know if its possible or not, if yes , how can i do it ? Cordialement, Best regards, ------------------------------------------------------------------- Pedro Reis Information Systems e-mail: pedro.reis@xxxxxxxxx Phone: 351-258 350 725 Fax: 351-258 350060 -------------------------------------------------------------------- VALEO - Electronics & Connective Systems Viana do Castelo - Portugal -------------------------------------------------------------------- "This e-mail message is intended only for the use of the named recipient(s). The information contained therein may be confidential or privileged, and its disclosure or reproduction is strictly prohibited. If you are not the named recipient, please return it immediately to its sender at the above address and destroy it." _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.