How to refer to Excel columns without headers in TSQL -
i dived documentation since didn't find information (well, found similarities other questions not want), i'm asking guys me :
i'm executing tsql query on adodb connection, retrieve data excel file (*.xlsx) one. file composed follow :
header1 header2 header3 --------- --------- --------- a1 b1 c1 a2 b2 c2 a3 b3 c3 .... .... ....
i want retrieve headers here's part of whole program, containing connection string
dim con adodb.connection dim rs adodb.recordset set con = new adodb.connection set rs = new adodb.recordset con .provider = "microsoft.ace.oledb.12.0" .connectionstring = "data source=path\file.xlsx; _ extended properties=""excel 12.0 xml;hdr=no;imex=1""" set rs = .execute("select * [sheet1$]") .close end
here retrieve columns, if want column b, column a, column c, e.g. :
set rs = .execute("select colb, cola, colc [sheet1$]")
the problem there don't know terms should replace colb, cola, colc since can't use headers of columns
regards
ps : don't know these technologies, may wrong terminology.
not answer, colleague sits next me ;)
set rs = .execute("select f2, f1, f3 [sheet1$]")
(not tested)
Comments
Post a Comment