ASP - ayuda

 
Vista:

ayuda

Publicado por jose Garcia (1 intervención) el 10/11/2006 14:07:02
Un favor quien me puede ayudar en este caso nesecito grabar unos datos en txt en asp como lo puedo hacer ?

muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ayuda

Publicado por miriam (4 intervenciones) el 13/11/2006 17:13:10
<%
Server.ScriptTimeout = 600
Response.ContentType = "text/tab-separated-values"

%>
<%
Set fs = CreateObject("Scripting.FileSystemObject")
Set act = fs.CreateTextFile("C:\Inetpub\wwwroot\tusitio\ejemplo.txt", True)
%>
<%
strSQL="SELECT TOP 10 FROM clientes"
Set rs = Conex.Execute(strSQL)
'Darle un espacio con el tab asi
Coma = " "
i=0
do while not rs.EOF
act.Write(rs("id_cliente"))
act.Write(coma)
act.Write(rs("razon_social"))
act.Write(coma)
act.Write(rs("a_paterno"))
act.Write(coma)
act.Write(rs("a_materno"))
act.WriteLine(txt)
i=i+1
rs.MoveNext
loop
act.Close
'Response.Write("Se han copiado " & i & " registros.")
%>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ayuda

Publicado por miriam (4 intervenciones) el 15/11/2006 01:01:37
<%
thetext=Write this text in the file
Set fs = CreateObject(Scripting.FileSystemObject)

Set wfile = fs.CreateTextFile(c:\\Mydir\\myfile.txt, True)
wfile.Write (thetext)

wfile.close
Set wfile=nothing
Set fs=nothing

response.write(Text created)
%>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar