Code :
- Dim fs, var, i
- var = Request.QueryString("path" )
- Set rs = Server.CreateObject("ADODB.recordset" )
- set fs = CreateObject("Scripting.FileSystemObject" )
- nRep = Server.MapPath("." ) & "\todo\"
- i = 0
- if fs.FileExists(var) then
- set MonFichier = fs.OpenTextFile(var,1,false)
- While not MonFichier.atEndOfStream
- 'dès ici ça chie
- sqlval=MonFichier.Readline
- sql = "INSERT INTO (...) values "
- 'transformation en requete
- sqlval = left(sqlval,len(sqlval)-1)
- sqlval = replace(sqlval,"'"," " )
- sqlval = replace(sqlval," ;",";" )
- sqlval = replace(sqlval,";","','" )
- sqlval = "('" & sqlval & "')"
- sql = sql + sqlval
- rs.Open sql,db,3
- i = i + 1
- wend
- end if
|