Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/05/2004, 02:03
rrufo
 
Fecha de Ingreso: enero-2002
Mensajes: 1.438
Antigüedad: 23 años, 3 meses
Puntos: 0
Cierto, miguel me paso este codigo copiado de un tutorial


<%
accessdb="state_info"
Set Conn = Server.CreateObject("ADODB.Connection")
'-----------------------------------
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\mdb-database\rm.mdb")
' ----------------------------------

Set rs = Server.CreateObject("ADODB.Recordset")
motSQL = "SELECT * FROM usuaris ORDER BY adresa"

rs.Open motSQL, conn
rs.MoveFirst

file_being_created= "usuaris.xls"

set fso = createobject("scripting.filesystemobject")

Set act = fso.CreateTextFile(server.mappath("\public\usuaris .xls"), true)

'Cabeceras de la tabla
act.WriteLine("<html><body>")
act.WriteLine("<table border=""1"">")
act.WriteLine("<tr>")
act.WriteLine("<th nowrap>Nom</th>")
act.WriteLine("<th nowrap>Adresa</th>")
act.WriteLine("<th nowrap>Data</th>")
act.WriteLine("<th nowrap>Observacions</th>")
act.WriteLine("</tr>")

Do while not rs.eof

Act.WriteLine("<tr>")
act.WriteLine("<td align=""right"">" & rs("nom") & "</td>" )
act.WriteLine("<td align=""right"">" & rs("adresa") & "</td>" )
act.WriteLine("<td align=""right"">" & rs("data") & "</td>")
act.WriteLine("<td align=""right"">"& rs("observacions") & "</td>")
act.WriteLine("</tr>")

rs.movenext
Loop


act.WriteLine("</table></body></html>")

act.close
%>