Discussion:
HELP!!, I need to execute a remote command
(too old to reply)
tghuat
2004-06-08 19:00:54 UTC
Permalink
Hi anyone can help me here??.

I need to execute a remote command in the AS/400 from either SQL or VB6.
Anyone knows the method ?

thanks in advance

Ian
Peter Kinsman
2004-06-08 20:37:21 UTC
Permalink
This is the way I have done it in the past:

Public cnAS400 As ADODB.Connection, Rcds As Variant

Option Compare Database
Option Explicit

Private Sub cmdDisplayLibraries_Click()

Set cnAS400 = New ADODB.Connection
cnAS400.Open "Provider=IBMDA400; data source=System-Name", "User-ID",
"Password"

cnAS400.Execute "{{QSYS/DSPFD FILE(*ALLUSR/QS36SRC) TYPE(*RCDFMT) " & _
"OUTPUT(*OUTFILE) OUTFILE(QS36F/S36LIBS)}}", Rcds,
adCmdText

The double braces are a signal to IBMDA400 to pass the command string to the
AS/400.

Best of luck

Peter Kinsman
Post by tghuat
Hi anyone can help me here??.
I need to execute a remote command in the AS/400 from either SQL or VB6.
Anyone knows the method ?
thanks in advance
Ian
tghuat
2004-06-09 04:38:01 UTC
Permalink
Hi peter,

thanks for your help. Let me try this out.
Post by Peter Kinsman
Public cnAS400 As ADODB.Connection, Rcds As Variant
Option Compare Database
Option Explicit
Private Sub cmdDisplayLibraries_Click()
Set cnAS400 = New ADODB.Connection
cnAS400.Open "Provider=IBMDA400; data source=System-Name", "User-ID",
"Password"
cnAS400.Execute "{{QSYS/DSPFD FILE(*ALLUSR/QS36SRC) TYPE(*RCDFMT) " & _
"OUTPUT(*OUTFILE) OUTFILE(QS36F/S36LIBS)}}", Rcds,
adCmdText
The double braces are a signal to IBMDA400 to pass the command string to the
AS/400.
Best of luck
Peter Kinsman
Post by tghuat
Hi anyone can help me here??.
I need to execute a remote command in the AS/400 from either SQL or VB6.
Anyone knows the method ?
thanks in advance
Ian
Peter Kinsman
2004-06-09 08:51:21 UTC
Permalink
Ian

I cannot claim any originality for the code I sent you. It starts at page
230 in the redbook "A Fast Path to AS/400 Client/Server Using AS/400 OLE DB
Support" SG24-5183-00. This first appeared in July 1998 so may no longer be
supported but is worth trying as it operates synchronously, wehereas if you
use a Shell command you need to check for when the AS/400 command has
finished.

Peter Kinsman
Post by tghuat
Hi anyone can help me here??.
I need to execute a remote command in the AS/400 from either SQL or VB6.
Anyone knows the method ?
thanks in advance
Ian
Loading...