' makecsv.asp -- Makes a CSV output to browser. ' * If any fields contain linefeeds (like HTML for example), you can't use \n as row terminator. ' * Use | for field terminator and ~ for row terminator (or whatever isn't likely to be in your data). ' * Run the asp script on the web server and save the resultant browser page as something.csv ' * Open the file in UltraEdit and convert it to a Unicode file. If you don't, MSSMSE will refuse to make the table Unicode upon import. ' * Remove the linefeeds after the ~'s -- the only linefeeds should be within the html field. Dim conn, rs, ft, rt Set conn = Server.CreateObject("ADODB.connection") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../../db/pages.mdb") & ";" ' If your web host no longer supports the JET4 driver, try the newer ACE12 driver: ' like: "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=... Set rs = Server.CreateObject("ADODB.Recordset") rs.Open "SELECT * FROM pages ORDER BY ID;",conn ft = "|" 'your desired field terminator rt = "~" 'your desired row terminator DO UNTIL rs.EOF response.write rs("ID") & ft & rs("PageTitle") & ft & rs("PageHtml") & rt rs.movenext LOOP rs.close Set rs = Nothing conn.close Set conn = Nothing