HOME > ASP > ASP Forum > รบกวนเรื่อง database หน่อยค่ะ ต้องการวันนี้ ฟอร์มรับส่งข้อมูล Error Type: Microsoft JET Database Engine (0x80004005) Operation must use an updateable query
รบกวนเรื่อง database หน่อยค่ะ ต้องการวันนี้ ฟอร์มรับส่งข้อมูล Error Type: Microsoft JET Database Engine (0x80004005) Operation must use an updateable query
แล้วที่ทำงานต้องเข้า ID ,pass เพื่อเข้ามาใช้งานใน Domain ในบริษิท หรือป่าวครับ
Date :
14 ก.พ. 2550 11:56:53
By :
AutoXAutoY
No. 8
Guest
login.asp ตัวที่ 1
<!--#include file="connect.asp"-->
<%
domain="suvas"
username=request("username")
if request("submit")="Log in" then
On Error resume next
set pUser = GetObject("WinNT://" & domain & "/" & username)
if Not IsObject(pUser) then
session("errLogin")="e01" ''äÁ辺ª×èͼÙéãªé§Ò¹!!
'response.write session("errLogin")
else
pUser.ChangePassword request("password"), request("password")
if err.number = -2147024810 then
session("errLogin")="e02" 'ÃËÑʼèÒ¹äÁè¶Ù¡µéͧ!!
'response.write session("errLogin")
elseif err.number = -2147022651 then
sql="select calendar,username,password,pm,worker_name,worker_surname,worker_id from worker where username='" & username & "' and status='0'"
set rs=db.execute(sql)
if not (rs.eof=true and rs.bof = true) then 'Check user ã¹°Ò¹¢éÍÁÙÅ eCIC
session("full_name")=rs("worker_name") & " " & rs("worker_surname")
session("username")=rs("username")
session("worker_id")=rs("worker_id")
session("user_type")=rs("pm")
'session("calendar_type")=rs("calendar")
rs.close()
set rs=nothing
db.close
set db=nothing
response.write "<script>parent.location = ""index.asp""</script>"
else
session("errLogin")="e10" '·èÒ¹ÂѧäÁèÁÕÃÒª×èÍã¹ÃÒ¡ÒüÙéãªé§Ò¹â»Ãá¡ÃÁ ¡ÃسҵԴµèÍ [email protected]
rs.close()
set rs=nothing
db.close
set db=nothing
end if
end if
end if
else
if request("cancel")="Cancel" then
session("errLogin")=""
response.write "<script>parent.location = ""index.asp""</script>"
end if
end if
'********* ERROR DETIAL *********'
if session("errLogin")="e01" then
err_des=" äÁ辺ª×èͼÙéãªé§Ò¹!! "
elseif session("errLogin")="e02" then
err_des=" ÃËÑʼèÒ¹äÁè¶Ù¡µéͧ!! "
elseif session("errLogin")="e10" then
err_des=" ·èÒ¹ÂѧäÁèÁÕÃÒª×èÍã¹ÃÒ¡ÒüÙéãªé§Ò¹â»Ãá¡ÃÁ ¡ÃسҵԴµèÍ [email protected] "
end if
'********* ERROR DETIAL *********'
%>
<html>
<p align="center"><font face="Microsoft Sans Serif" size="2" color="#FF0000">
<span><%=err_des%></span></font></p>
</body>
</html>
login_nopermission.asp ตัวที่ 2
<!--#include file="connect.asp"-->
<%
if request("submit")="Log in" then
username=request("username")
password=request("password")
sql="select calendar,username,password,pm,worker_name,worker_surname,worker_id from worker where username='" & username & "' and password='" & password & "' and status='0'"
set rs=db.execute(sql)
if not (rs.eof=true and rs.bof = true) then
session("full_name")=rs("worker_name") & " " & rs("worker_surname")
session("username")=rs("username")
session("worker_id")=rs("worker_id")
session("user_type")=rs("pm")
'session("calendar_type")=rs("calendar")
rs.close()
response.write "<script>parent.location = ""index.asp""</script>"
else
err=true
rs.close()
end if
set rs=nothing
db.close
set db =nothing
else
if request("cancel")="Cancel" then response.redirect "index.htm"
end if
%>
<html>