%@ Language=VBScript %>
s&t
<%
read=request("read")
if read="Read File" then
Dim i_code,i_desc,stk,ordr,a_dt,qty
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(Server.MapPath("STKNET.txt"),1,true)
f.SkipLine
f.SkipLine
f.SkipLine
f.SkipLine
f.SkipLine
f.SkipLine
do while not f.AtEndOfStream
d=f.ReadLine()
'response.write("Full Line:"&d)
text=split(d,"|")
'response.write("splited line:
")
i_code=Trim(text(0))
'response.write("i_code:"&i_code &"
")
i_desc=Trim(text(1))
'response.write("i_desc:"&i_desc &"
")
stk=Trim(text(2))
'response.write("stock:"&stk &"
")
ordr=Trim(text(3))
'response.write("order:"&ordr &"
")
a_dt=Trim(text(4))
'response.write("active_date:"&a_dt &"
")
qty=Trim(text(5))
'response.write("quantity:"&qty)
sql="insert into test(i_code,i_desc,stock,ord,a_date,qua) values ('"&i_code&"','"&i_desc&"',"&stk&","&ordr&",'"&a_dt&"',"&qty&")"
'response.write(sql)
cn.Execute(sql)
f.SkipLine
loop
set rs=nothing
cn.Close
set cn=nothing
f.Close
set f=Nothing
set fs=Nothing
end if
%>