0
我有这个查询,我必须在Excel中多次运行,并且需要更改文件列表中的文件列表。如何从文本文件中读取大文件列表以形成查询
select * from files
where
filename in ('filename1','filename2')
所以我有一个TEMP在我的查询文件名在TEMP中,我想循环并得到所有文件列表的结果。我唯一的问题是将TEMP读入.txt并对txt文件中的所有文件名执行一次查询。我知道如何逐行阅读文件,所以没有帮助。
,我想从阅读列表我的文本文件都喜欢
文件名1 文件名2 。 。 。 。 文件名15000
是的一些大数字。
dim filelist as string
dim filelistpath as string
sqlstring = "select count(*) from files where filename in TEMP"
filelistpath = "c:\"
open filelistpath for input as #1
do while not EOF(1)
line input #1,text
'here i should construct my file list to replace the TEMP below, how ?
loop
close #1
sqlstring = replace(sqlstring,TEMP, filelist)
set rs = conn.execute(sqlstring)
'here i want to write the result to my excel sheet, how ?
感谢
你提的问题是非常令人迷惑。请提供您已经尝试过的代码,以便我们可以更好地理清您实际尝试做的事情。 – RBarryYoung
我会很快做到这一点,因为它在我的pendrive上,我正在回家的路上:) – trackmeifUcan
有没有办法将整个文本文件读入变体或其他东西? – trackmeifUcan