取出excel中的所有sheet表名的sql语句怎么写
1个回答
展开全部
路径改成你的文件路径,应该就可以了,不过好象得到的EXCEL表名后面都有个$
Dim gconnection As New ADODB.Connection
strcnn = "DSN=excel files;dbq=" & App.Path & "\xx.xls"
gconnection.Open constr
Set TableSet = gconnection.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, Empty))
Do Until TableSet.EOF
List1.AddItem TableSet!table_name
TableSet.MoveNext
Loop
Dim gconnection As New ADODB.Connection
strcnn = "DSN=excel files;dbq=" & App.Path & "\xx.xls"
gconnection.Open constr
Set TableSet = gconnection.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, Empty))
Do Until TableSet.EOF
List1.AddItem TableSet!table_name
TableSet.MoveNext
Loop
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |