<% private Function AsDBString(ByVal strCh, ByVal WithQuotes) ' rmplace les simples quotes à l'intérieur d'une chaîne par ´ ( fausse simple quote ) Dim res Dim i If IsNull(strCh) then 'AsDBString = "''" AsDBString = "" Exit Function ElseIf Trim(CStr(strCh)) = "" then 'AsDBString = "''" AsDBString = "" Exit Function End If strCh = CStr(strCh) res = "" For i = 1 To Len(strCh) If Mid(strCh, i, 1) <> "'" Then res = res & Mid(strCh, i, 1) Else res = res & "\' " ' res = res & " ´" End If Next If WithQuotes then res = "'" & res & "'" AsDBString = res End Function %> <% Dim chemin Set objFs = Server.CreateObject("Scripting.FileSystemObject") ' cree un objet scripting chemin = Server.MapPath("./Articles" ) ' determine le chemin des fichiers a lire cpt=0 set objDossier = objFs.getFolder(chemin) ' objDossier est le repertoire ou se trouvent les fichiers de type scripting a lire for each Fichier in objDossier.Files ' pour chaque fichier dans le repertoire set objFic=objFs.OpenTextFile(Fichier) ' objFic est le fichier a lire ' Do While objFic.AtEndOfStream <> True ligne=objFic.readLine ' ligne est la ligne en cours du fichier lu 'ligne="'" & ligne & "'" ligne=DateValue(ligne) if (day(ligne)<10) then dayligne="0" & day(ligne) else dayligne= day(ligne) end if if (month(ligne)<10) then monthligne="0" & month(ligne) else monthligne= month(ligne) end if DateInv= year(ligne) & "/" & monthligne & "/" & dayligne 'response.write("date inv : " & DateInv) %> <%ligne=objFic.readLine ' ligne suivante ligne=asdbstring(ligne ,true)%> <%ligne=objFic.readLine ligne="'" & ligne & "'" %> <%ligne=objFic.readLine ligne=asdbstring(ligne ,true)%> <% ligne=objFic.readLine ligne=asdbstring(ligne ,true)%> <%ligne=objFic.readLine ligne=asdbstring(ligne ,true)%> <%ligne=objFic.readLine ligne=asdbstring(ligne ,true)%> <% 'loop objFic.close ' fermeture de l'objet fichier cpt=cpt+1 next Set objFs = Nothing Set objDossier = Nothing %>
L A  P R E S S E