请帮忙看一下这个代码,关于FSO文件操作。
wqdz 2004-06-11 07:12:15 以下这段在操作系统2003编译成exe文件后,在win98下使用不能打开数据,并提示出错。而在win98下编译成exe文件后,在win2003下使用没有问题。请问是什么原因?是否与scrrun.dll有关,我看到win98下的该文件版本为5.0.0.3715,而在win2003下为5.6.0.8515。
public sub subdqshuj()
'读入数据
dim i as integer, fso as new filesystemobject, wb as string
on error goto handlerror
k = 0
'读取数据
strfilename = iif(right(app.path, 1) = "\", app.path, app.path & "\") & "abc.txt"
if fso.fileexists(strfilename) = true then '好像在这里出错。
open strfilename for input as 1
do until eof(1)
input #1, wb
loop
close #1
else
msgbox("文件:" + strfilename + " 不存在,请重新安装本软件。", vbexclamation, "问题提示"
end if
exit sub
handlerror:
msgbox("数据读取出错,请重新安装本软件。", vbexclamation, "问题提示"
end sub