Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

ASP Classic xlsx file connect and retrieve columns

$
0
0
Hi there,

Is there any asp classic code to retrieve all the columns from a csv file, some columns are not required therefore I need to select only those columns I need to process the data; currently i have to delete the columns from csv manually.

the code below works for showing the data from csv.

thanks.

===========================
data_filenam = request("csvfilename")
x = server.MapPath("csv")

Set ConnCSV = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

ConnCSV.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & x & ";Extended Properties=""text;HDR=YES;"""

strDirInfoX="SELECT * FROM " & data_filenam

set rs = ConnCSV.Execute(strDirInfoX)

if not rs.eof then
response.write rs(0) &"<br>"
response.write rs(1) &"<br>"
response.write rs(2) &"<br>"
end if
=========================


This code works when executed directly in the MySQL Admin interface but does not work when replaced with strDirInfoX sql code above

strDirInfoX="SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'importDataFile' "

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>