Showing posts with label file management. Show all posts
Showing posts with label file management. Show all posts

July 9, 2009

Export Recordset Data to CSV Using ASP/VBScript

The CSV (Comma-Separated Values) file format is a text file format in which you can store tabular data, such as data from a database table. This format is can be read by various spread sheet programs such as Microsoft Excel and OpenOffice.org Calc. This format is not suitable for storing binary data.

The following ASP/VBScript code sample allows you to export data from a database table to a CSV file. The code accesses the table through an ADODB Recordset object, formats the data into the CSV format and sends the data to the browser along with appropriate response headers. This code should be saved as an ASP script on a webserver. You should see an "Open/Save As..." dialog when you access the script through a web browser.

May 19, 2009

List Images and Other Files Types in a Directory Using ASP

This is a nice and simple ASP+VBScript code snippet that lists the files present in the specified directory (folder). The ready-to-go example below displays the list of images. However, the code can display files depending on filename extension. The script also returns additional information about the files such as type, size and date modified.