师哥师姐,帮帮我!~~一个菜鸟问题,急~~
12920241 2002-08-15 11:27:00 01
12918338 2002-08-15 12:30:00 01
12920210 2002-08-15 12:31:00 01
12913650 2002-08-15 12:31:00 01
12919060 2002-08-15 12:31:00 01
12917212 2002-08-15 12:31:00 01
===============以上是2002-08-15.txt内容===============
<!-- #Include File="../dsn/conn.asp" -->
<%
Dim fso,strFso
Dim temp,counter,tempArray,strSql
Set fso = server.CreateObject("Scripting.FileSystemObject")
Set strFso = fso.OpenTextFile("d:\test\files\2002-08-15.txt", 1)
Do While strFso.AtEndOfStream <> True
temp = temp & strFso.readline
loop
Set fso=nothing
Set strFso = nothing
'将读出来的按成数组
tempArray = split(temp)
'12920241 2002-08-15 11:27:00 01
'1......8...
for i=LBOUND(tempArray) to UBOUND(tempArray)
str1=Mid(tempArray, 1, 8) '卡号:12920241
str2=Mid(tempArray, 10, 19) '日期:2003-08-15
str3=Mid(tempArray, 21, 28) '时间:11:27:00
str4=Mid(tempArray, 30, 31) '机号:01
sql=insert into attendance (staff_ID,rDate,rTime,rNO) values ('"&str1&"',
'"&str2&"','"&str3&"','"&str4&"')
conn.execute(sql)
next
执行到这一句系统就报错:
str1=Mid(tempArray, 1, 8) '卡号:12920241
帮我看看,我的程序那里有问题??