J'essaie d'envoyer via INET un fichier pr=E9sent sur un=20
poste micro vers sur serveur MVS ou Z/OS. Le fichier se=20
transf=E8re mais j'ai un soucis de la translation de=20
caract=E8res. J'envoie de l'ASCII (ou binaire?) sur un=20
serveur en EBCDIC. Existe-t-il un param=E8tre =E0 donner au=20
module INET pour corriger cette anomalie.
A tout hazard, je vous joins le code :
VERSION 5.00
Object =3D "{48E59290-9880-11CF-9754-00AA00C00908}
#1.0#0"; "MSINET.OCX"
Begin VB.Form Form1=20
Caption =3D "Envoie FTP : Micro --> Host"
ClientHeight =3D 990
ClientLeft =3D 60
ClientTop =3D 345
ClientWidth =3D 4455
LinkTopic =3D "Form1"
ScaleHeight =3D 990
ScaleWidth =3D 4455
StartUpPosition =3D 3 'Windows Default
Begin InetCtlsObjects.Inet Inet1=20
Left =3D 3600
Top =3D 240
_ExtentX =3D 1005
_ExtentY =3D 1005
_Version =3D 393216
Protocol =3D 2
RemoteHost =3D "123.123.12.12"
RemotePort =3D 21
URL =3D "ftp://UserName@123.123.12.12"
UserName =3D "UserName"
Password =3D "Password"
End
Begin VB.Label Label2=20
Caption =3D "Etat :"
Height =3D 495
Left =3D 120
TabIndex =3D 1
Top =3D 240
Width =3D 975
End
Begin VB.Label Label1=20
Height =3D 495
Left =3D 1320
TabIndex =3D 0
Top =3D 240
Width =3D 2895
End
End
Attribute VB_Name =3D "Form1"
Attribute VB_GlobalNameSpace =3D False
Attribute VB_Creatable =3D False
Attribute VB_PredeclaredId =3D True
Attribute VB_Exposed =3D False
Private Sub Form_Load()
Form1.Show
With Inet1
.Execute , "PUT R:/fichier.txt N00SD.fichier"
End With
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant ' Data variable.
Select Case State
Case icResponseReceived '8
Form1.Label1.Caption =3D "Chargement en=20
cours..."
vtData =3D Inet1.ResponseCode & ":" & _
Inet1.ResponseInfo
Case icError ' 11
vtData =3D Inet1.ResponseCode & ":" & _
Inet1.ResponseInfo
Case icResponseCompleted ' 12
Dim strData As String: strData =3D ""
Dim bDone As Boolean: bDone =3D False
' Get first chunk.
vtData =3D Inet1.GetChunk(1024, icString)
DoEvents
Do While Not bDone
strData =3D strData & vtData
' Get next chunk.
vtData =3D Inet1.GetChunk(1024, icString)
DoEvents
If Len(vtData) =3D 0 Then
bDone =3D True
End If
Loop
=20
If strData <> "" Then
MsgBox strData
Else
Form1.Label1.Caption =3D "Chargement termin=E9 !"
Inet1.Cancel
End If
End Select
End Sub
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
EddiGordo
"Olivier" vient de nous annoncer :
J'essaie d'envoyer via INET un fichier présent sur un poste micro vers sur serveur MVS ou Z/OS. Le fichier se transfère mais j'ai un soucis de la translation de caractères. J'envoie de l'ASCII (ou binaire?) sur un serveur en EBCDIC. Existe-t-il un paramètre à donner au module INET pour corriger cette anomalie.
A tout hazard, je vous joins le code :
VERSION 5.00 Object = "{48E59290-9880-11CF-9754-00AA00C00908} #1.0#0"; "MSINET.OCX" Begin VB.Form Form1 Caption = "Envoie FTP : Micro --> Host" ClientHeight = 990 ClientLeft = 60 ClientTop = 345 ClientWidth = 4455 LinkTopic = "Form1" ScaleHeight = 990 ScaleWidth = 4455 StartUpPosition = 3 'Windows Default Begin InetCtlsObjects.Inet Inet1 Left = 3600 Top = 240 _ExtentX = 1005 _ExtentY = 1005 _Version = 393216 Protocol = 2 RemoteHost = "123.123.12.12" RemotePort = 21 URL = "ftp://" UserName = "UserName" Password = "Password" End Begin VB.Label Label2 Caption = "Etat :" Height = 495 Left = 120 TabIndex = 1 Top = 240 Width = 975 End Begin VB.Label Label1 Height = 495 Left = 1320 TabIndex = 0 Top = 240 Width = 2895 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Form_Load() Form1.Show With Inet1 .Execute , "PUT R:/fichier.txt N00SD.fichier" End With End Sub Private Sub Inet1_StateChanged(ByVal State As Integer) Dim vtData As Variant ' Data variable. Select Case State Case icResponseReceived '8 Form1.Label1.Caption = "Chargement en cours..." vtData = Inet1.ResponseCode & ":" & _ Inet1.ResponseInfo Case icError ' 11 vtData = Inet1.ResponseCode & ":" & _ Inet1.ResponseInfo Case icResponseCompleted ' 12 Dim strData As String: strData = "" Dim bDone As Boolean: bDone = False ' Get first chunk. vtData = Inet1.GetChunk(1024, icString) DoEvents Do While Not bDone strData = strData & vtData ' Get next chunk. vtData = Inet1.GetChunk(1024, icString) DoEvents If Len(vtData) = 0 Then bDone = True End If Loop
If strData <> "" Then MsgBox strData Else Form1.Label1.Caption = "Chargement terminé !" Inet1.Cancel End If End Select End Sub
Bonjour
Je ne sais pas si un paramètre existe mais tu peux peut-être transposer toi même le fichier à envoyer à l'aide de ces routines :
Option Explicit
Dim a2eG As Variant Dim e2aG As Variant
Function AsciiToEbcdic(ByVal Str As String) As String Dim T As Long, Tmp As String If Len(Str) = 0 Then AsciiToEbcdic = "" Else For T = 1 To Len(Str) Tmp = Tmp & Chr(a2eG(Asc(Mid(Str, T, 1)))) Next T AsciiToEbcdic = Tmp End If End Function
Function EbcdicToAscii(ByVal Str As String) As String Dim T As Long, Tmp As String If Len(Str) = 0 Then EbcdicToAscii = "" Else For T = 1 To Len(Str) Tmp = Tmp & Chr(e2aG(Asc(Mid(Str, T, 1)))) Next T EbcdicToAscii = Tmp End If End Function
J'essaie d'envoyer via INET un fichier présent sur un
poste micro vers sur serveur MVS ou Z/OS. Le fichier se
transfère mais j'ai un soucis de la translation de
caractères. J'envoie de l'ASCII (ou binaire?) sur un
serveur en EBCDIC. Existe-t-il un paramètre à donner au
module INET pour corriger cette anomalie.
A tout hazard, je vous joins le code :
VERSION 5.00
Object = "{48E59290-9880-11CF-9754-00AA00C00908}
#1.0#0"; "MSINET.OCX"
Begin VB.Form Form1
Caption = "Envoie FTP : Micro --> Host"
ClientHeight = 990
ClientLeft = 60
ClientTop = 345
ClientWidth = 4455
LinkTopic = "Form1"
ScaleHeight = 990
ScaleWidth = 4455
StartUpPosition = 3 'Windows Default
Begin InetCtlsObjects.Inet Inet1
Left = 3600
Top = 240
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
Protocol = 2
RemoteHost = "123.123.12.12"
RemotePort = 21
URL = "ftp://UserName@123.123.12.12"
UserName = "UserName"
Password = "Password"
End
Begin VB.Label Label2
Caption = "Etat :"
Height = 495
Left = 120
TabIndex = 1
Top = 240
Width = 975
End
Begin VB.Label Label1
Height = 495
Left = 1320
TabIndex = 0
Top = 240
Width = 2895
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Form1.Show
With Inet1
.Execute , "PUT R:/fichier.txt N00SD.fichier"
End With
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant ' Data variable.
Select Case State
Case icResponseReceived '8
Form1.Label1.Caption = "Chargement en
cours..."
vtData = Inet1.ResponseCode & ":" & _
Inet1.ResponseInfo
Case icError ' 11
vtData = Inet1.ResponseCode & ":" & _
Inet1.ResponseInfo
Case icResponseCompleted ' 12
Dim strData As String: strData = ""
Dim bDone As Boolean: bDone = False
' Get first chunk.
vtData = Inet1.GetChunk(1024, icString)
DoEvents
Do While Not bDone
strData = strData & vtData
' Get next chunk.
vtData = Inet1.GetChunk(1024, icString)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Loop
If strData <> "" Then
MsgBox strData
Else
Form1.Label1.Caption = "Chargement terminé !"
Inet1.Cancel
End If
End Select
End Sub
Bonjour
Je ne sais pas si un paramètre existe mais tu peux peut-être transposer
toi même le fichier à envoyer à l'aide de ces routines :
Option Explicit
Dim a2eG As Variant
Dim e2aG As Variant
Function AsciiToEbcdic(ByVal Str As String) As String
Dim T As Long, Tmp As String
If Len(Str) = 0 Then
AsciiToEbcdic = ""
Else
For T = 1 To Len(Str)
Tmp = Tmp & Chr(a2eG(Asc(Mid(Str, T,
1))))
Next T
AsciiToEbcdic = Tmp
End If
End Function
Function EbcdicToAscii(ByVal Str As String) As String
Dim T As Long, Tmp As String
If Len(Str) = 0 Then
EbcdicToAscii = ""
Else
For T = 1 To Len(Str)
Tmp = Tmp & Chr(e2aG(Asc(Mid(Str, T,
1))))
Next T
EbcdicToAscii = Tmp
End If
End Function
J'essaie d'envoyer via INET un fichier présent sur un poste micro vers sur serveur MVS ou Z/OS. Le fichier se transfère mais j'ai un soucis de la translation de caractères. J'envoie de l'ASCII (ou binaire?) sur un serveur en EBCDIC. Existe-t-il un paramètre à donner au module INET pour corriger cette anomalie.
A tout hazard, je vous joins le code :
VERSION 5.00 Object = "{48E59290-9880-11CF-9754-00AA00C00908} #1.0#0"; "MSINET.OCX" Begin VB.Form Form1 Caption = "Envoie FTP : Micro --> Host" ClientHeight = 990 ClientLeft = 60 ClientTop = 345 ClientWidth = 4455 LinkTopic = "Form1" ScaleHeight = 990 ScaleWidth = 4455 StartUpPosition = 3 'Windows Default Begin InetCtlsObjects.Inet Inet1 Left = 3600 Top = 240 _ExtentX = 1005 _ExtentY = 1005 _Version = 393216 Protocol = 2 RemoteHost = "123.123.12.12" RemotePort = 21 URL = "ftp://" UserName = "UserName" Password = "Password" End Begin VB.Label Label2 Caption = "Etat :" Height = 495 Left = 120 TabIndex = 1 Top = 240 Width = 975 End Begin VB.Label Label1 Height = 495 Left = 1320 TabIndex = 0 Top = 240 Width = 2895 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Form_Load() Form1.Show With Inet1 .Execute , "PUT R:/fichier.txt N00SD.fichier" End With End Sub Private Sub Inet1_StateChanged(ByVal State As Integer) Dim vtData As Variant ' Data variable. Select Case State Case icResponseReceived '8 Form1.Label1.Caption = "Chargement en cours..." vtData = Inet1.ResponseCode & ":" & _ Inet1.ResponseInfo Case icError ' 11 vtData = Inet1.ResponseCode & ":" & _ Inet1.ResponseInfo Case icResponseCompleted ' 12 Dim strData As String: strData = "" Dim bDone As Boolean: bDone = False ' Get first chunk. vtData = Inet1.GetChunk(1024, icString) DoEvents Do While Not bDone strData = strData & vtData ' Get next chunk. vtData = Inet1.GetChunk(1024, icString) DoEvents If Len(vtData) = 0 Then bDone = True End If Loop
If strData <> "" Then MsgBox strData Else Form1.Label1.Caption = "Chargement terminé !" Inet1.Cancel End If End Select End Sub
Bonjour
Je ne sais pas si un paramètre existe mais tu peux peut-être transposer toi même le fichier à envoyer à l'aide de ces routines :
Option Explicit
Dim a2eG As Variant Dim e2aG As Variant
Function AsciiToEbcdic(ByVal Str As String) As String Dim T As Long, Tmp As String If Len(Str) = 0 Then AsciiToEbcdic = "" Else For T = 1 To Len(Str) Tmp = Tmp & Chr(a2eG(Asc(Mid(Str, T, 1)))) Next T AsciiToEbcdic = Tmp End If End Function
Function EbcdicToAscii(ByVal Str As String) As String Dim T As Long, Tmp As String If Len(Str) = 0 Then EbcdicToAscii = "" Else For T = 1 To Len(Str) Tmp = Tmp & Chr(e2aG(Asc(Mid(Str, T, 1)))) Next T EbcdicToAscii = Tmp End If End Function