Bonjour cher amis!!

Je vous présente un extrait d'un code généré sous VBScript pour réalisé la transformation d'une colonne lors de l'exécution d'un lot DTS. l'objectif de ce programme est de recuperer le nom réel du fichier, dont le chemin global est stocké dans la variable DTSGlobalVariables("stock"). Voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
Function Main()
DTSGlobalVariables("stock")="F:\Projet_MTNCI_TICKETS\Dossier_Projet\Fichier_Acc\dbdump-01082007.txt"
 
DTSGlobalVariables("i")= 1
 
DTSGlobalVariables("test") = " "
 
While  DTSGlobalVariables("test") <> "\"
 
DTSGlobalVariables("i ")= DTSGlobalVariables("i ")+ 1
 
DTSGlobalVariables("test") = Left(Right(DTSGlobalVariables("stock"), Len(DTSGlobalVariables("stock")) - (Len(DTSGlobalVariables("stock")) - DTSGlobalVariables("i "))), 1)
 
Wend
 
For  DTSGlobalVariables("j ") = DTSGlobalVariables("i ")- 1 To 1 Step -1
 
DTSGlobalVariables("recup") = DTSGlobalVariables("recup")  & Left(Right(DTSGlobalVariables("stock"), Len(DTSGlobalVariables("stock")) - (Len(DTSGlobalVariables("stock")) - DTSGlobalVariables("j"))), 1)
 
Next
 
DTSGlobalVariables("Position1")=Instr( DTSGlobalVariables("recup"),"-")
 
DTSGlobalVariables("Position2 ")=Len( DTSGlobalVariables("recup"))- DTSGlobalVariables("Position1")
 
DTSGlobalVariables("Str2") =Right( DTSGlobalVariables("recup"),Position2 )
 
DTSGlobalVariables("date1")=Cdate(DTSGlobalVariables("Str2"))
 
DTSDestination("datejour")= DTSGlobalVariables("date1")
 
 
	Main = DTSTransformStat_OK
End Function
lors de la compilation du programme, voici l'erreur qui est générée:

Source de l'erreur: lot Microsoft Data Transformation service (DTS)

Description de l'erreur: Code d'erreur:0

Source d'erreur= Erreur de compilation Microsoft VBScript

Description d'erreur: Variable de controle de boucle 'for' incorrect

Erreur à la ligne 20.


Aidez moi à resoudre ce problème car c'est très urgent!

Merci