Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set uploadfile=fs.CreateTextFile(Server.Mappath("picture"&"/"&filename_new))
uploadfile.Write uploaddata.Item("file").Item("value")
uploadfile.Close
set fs=Nothing
Set Conn=Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("../data.mdb"),"" , ""
'ËÃ×ͨÐãªéà»ç¹ Conn.Open "product","",""
scode = uploaddata.Item("numid").item("value")
sql ="Select * From doc where num_id='"&scode&"'"
Set RS =Server.CreateObject("ADODB.Recordset")
RS.open Sql,Conn,1,3
if NOT(RS.EOF) then
response.write("รหัสเอกสารนี้มีอยู่แล้ว")
else
Rs.AddNew
Rs("num_id") = uploaddata.Item("numid").item("value")
Rs("type") = uploaddata.Item("select1").item("value")
Rs("tit_name") = uploaddata.Item("title").item("value")
'Rs("description") = Request.Form("desc")
Rs("date_in") = uploaddata.Item("date1").item("value")
Rs("images")=filename_new
Rs.Update
Conn.Close
end if
%>