Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ow... esse código transporta dados de bd para csv usando asp, mas eu não consigo fazer funcionar um where, podem me ajudar?
<%' GenerateXLS Version 1.0 by Brian Kirsten (bkirsten@brainscanstudios.com)' 1st modified 11/29/00' 2nd modification 10/25/02' copyright Ó 2000 Brain Scan Studios, Inc. (http://www.brainscanstudios.com)') source distributed under the gnu general public license.' let me know if your site is using the code i will put a link up to your page!Dim sTableDim sDSNDim sFieldssDSN = "<DSN>" 'Name of your DSNsFields = "<FIELDS>" 'List of fields comma delimitedsTable = "<TABLE_NAME>" 'Name of your table or ViewSet DB = Server.CreateObject("ADODB.Connection")Set RS = Server.CreateObject("ADODB.Recordset")DB.Open sDSNRS.Open "select "& sFields &" from "& sTable,DBResponse.ContentType = "application/csv"Response.AddHeader "Content-Disposition", "filename=mydata.csv;"' lets print the fields on topfor i = 0 to RS.Fields.Count-1if i = (RS.Fields.Count - 1) thenResponse.Write lcase(RS.Fields(i).Name)elseResponse.Write lcase(RS.Fields(i).Name) & ","end ifnextResponse.write vbNewLineResponse.write vbNewLinewhile not RS.EOFfor u=0 to RS.Fields.Count - 1if u = (RS.Fields.Count - 1) thenResponse.Write RS.Fields(u).ValueelseResponse.Write RS.Fields(u).Value & ","end ifnextresponse.write vbNewLiners.MoveNextwendResponse.write vbNewLineResponse.write vbNewLineSet RS = NothingSet DB = Nothing%>
valew!
Carregando comentários...