%@ Language=VBScript %>
<%
Dim i_code,i_desc,stk,ordr,a_dt,qty
Dim u_ldate,u_hr,u_min,u_sec,u_ltime,td
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(server.MapPath(".") & "\..\db\data.bin",1)
'start coding
f.SkipLine
d=f.ReadLine()
if trim(d)="" then
d=f.ReadLine()
end if
if trim(d)="" then
d=f.ReadLine()
end if
if trim(d)="" then
d=f.ReadLine()
end if
text=split(d,":")
u_date=Trim(text(1))
response.Write("Date : "&u_date&"
")
d=f.ReadLine()
text=split(d,":")
u_hr=Trim(text(1))
' response.Write("Hour : "&u_hr&"
")
u_min=Trim(text(2))
'response.Write("Minute : "&u_min&"
")
u_sec=Trim(text(3))
'response.Write("Second : "&u_sec&"
")
u_ltime=u_hr & ":" & u_min & ":" & u_sec
'response.Write("Actual Date : "&u_ldate&"
")
'cn.execute "update date1 set up_date='" & dt1 & "', up_time='" & dt2 & "'"
'sql1="insert into u_date(date,time) values ('"&u_ldate&"','"&u_ltime&"')"
cn.execute "update date1 set up_date='" & u_date & "', up_time='" & u_ltime & "'"
'response.Write(sql1)
'response.Write("Date & Time updated successfully!
")
'stop coding
'cn.execute "delete from u_date"
' cn.Execute(sql1)
'f.SkipLine
'f.SkipLine
'f.SkipLine
f.SkipLine
f.SkipLine
f.SkipLine
cn.execute "delete from test"
do while not f.AtEndOfStream
d=f.ReadLine()
'response.write("Full Line:"&d)
if trim(d)<>"" then
'td=d
'd=replace(td,"'","''")
'd=replace(d,,)
text=split(d,"|")
response.write("
splited line:
")
td=Trim(text(0))
i_code=replace(td,"'","''")
'response.write("i_code:"&i_code &"
")
td=Trim(text(1))
i_desc=replace(td,"'","''")
'i_desc=replace(i_desc,",",",")
'response.write("i_desc:"&i_desc &"
")
td=Trim(text(2))
stk=replace(td,"'","''")
'response.write("stock:"&stk &"
")
td=Trim(text(3))
ordr=replace(td,"'","''")
'response.write("order:"&ordr &"
")
td=Trim(text(4))
a_dt=replace(td,"'","''")
'response.write("active_date:"&a_dt &"
")
td=Trim(text(5))
qty=replace(td,"'","''")
'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&")"
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)
response.Write("
Record inserted Successfully!
")
end if
'f.SkipLine
loop
set rs=nothing
cn.Close
set cn=nothing
f.Close
set f=Nothing
set fs=Nothing
response.Redirect("admin.asp?msg=2")
%>