<%
dim a,sex1(12),sex2(12)
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db/personal.mdb")
set rs=server.createobject("adodb.recordset")
n1 = "นาย"
n2 = "นาง"
n3 = "นางสาว"
for a = 1 to 12
SQL = " SELECT jobpersonal.*,privatepersonal.*,count(privateperosnal.id) as countprid FROM [privatepersonal],[jobpersonal] WHERE [jobpersonal.jo_prcode]=[privatepersonal.id] and [jobpersonal.joid]='"&a&"' and [privatepersonal.prefixth]='"&n1&"' "
set Rs = Conn.Execute(SQL)
sex1(a)=rs(0)
next
%>
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression 'Jo_PrCode' as part of an aggregate function.
<%
dim b,edu(8),sexedu1(12),sexedu2(12)
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db/personal.mdb")
set rs=server.createobject("adodb.recordset")
edu(1) = "ป.6"
edu(2) = "ม.3"
edu(3) = "ม.6"
edu(4) = "ปวช."
edu(5) = "ปวส."
edu(6) = "ปริญญาตรี (หรือเทียบเท่า)"
edu(7) = "ปริญญาโท"
edu(8) = "ปริญญาเอก"
n1 = "นาย"
n2 = "นาง"
n3 = "นางสาว"
for b = 1 to 8
SQL = " SELECT count(privateperosnal.id) as countprid FROM [privatepersonal] WHERE [preduhigth]='"&edu(b)&"' and [privatepersonal.prefixth]='"&n1&"' "
set Rs = Conn.Execute(SQL)
sexedu1(b)=rs(0)
next
%>
นี่ก็ Error มันคือ
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/people/admin_main.asp, line 398
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression 'Jo_PrCode' as part of an aggregate function.
/people/admin_main.asp, line 215
<%
dim i,dept1(12),dept2(12),dept3(12),dname(12)
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db/personal.mdb")
set rs=server.createobject("adodb.recordset")
n1 = "ข้าราชการ"
n2 = "พนักงานราชการ"
n3 = "ลูกจ้าง"
for i = 1 to 12
SQL = " SELECT count(joid) as countjoid FROM [jobpersonal] WHERE [joid]='"&i&"' and [jotype]='"&n1&"' "
set Rs = Conn.Execute(SQL)
dept1(i)=rs(0)
next
for i = 1 to 12
SQL1 = " SELECT count(joid) as countjoid FROM [jobpersonal] WHERE [joid]='"&i&"' and [jotype]='"&n2&"' "
set Rs = Conn.Execute(SQL1)
dept2(i)=rs(0)
next
for i = 1 to 12
SQL2 = " SELECT count(joid) as countjoid FROM [jobpersonal] WHERE [joid]='"&i&"' and [jotype]='"&n3&"' "
set Rs = Conn.Execute(SQL2)
dept3(i)=rs(0)
next
rs.close
%>
นี่คือ จำแนกตามคุณวุฒิ
นี่คือ โค๊ดของแยกตามคุณวุฒิ
Code (ASP)
<%
dim c,sumedu(8),edu(8)
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db/personal.mdb")
set rs=server.createobject("adodb.recordset")
edu(1)="ป.6"
edu(2)="ม.3"
edu(3)="ม.6"
edu(4)="ปวช."
edu(5)="ปวส."
edu(6)="ปริญญาตรี (หรือเทียบเท่า)"
edu(7)="ปริญญาโท"
edu(8)="ปริญญาเอก"
for c = 1 to 8
SQL = " SELECT count(id) as countedu FROM [privatepersonal] WHERE [preduhigth]='"&edu(c)&"' "
set Rs = Conn.Execute(SQL)
sumedu(c)=rs(0)
totaledu=totaledu+sumedu(c)
next
rs.close
%>
และนี่คือ จำแนกตามใบประกอบวิชาชีพ
นี่คือ โค๊ดของจำแนกตามใบประกอบวิชาชีพครับ
Code (ASP)
<%
dim d,sumjopass(3),jopass(3)
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db/personal.mdb")
set rs=server.createobject("adodb.recordset")
jopass(1)="ผู้บริหาร"
jopass(2)="ครู"
jopass(3)="ไม่มี"
for d = 1 to 3
SQL = " SELECT count(jo_prcode) as countjo FROM [jobpersonal] WHERE [jopass]='"&jopass(d)&"' "
set Rs = Conn.Execute(SQL)
sumjopass(d)=rs(0)
totaljopass=totaljopass+sumjopass(d)
next
rs.close
%>
<%
dim a,sex1(12),sex2(12),dsex(12)
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db/personal.mdb")
set rs=server.createobject("adodb.recordset")
n1 = "นาย"
n2 = "นาง"
n3 = "นางสาว"
for a = 1 to 12
SQL = " SELECT jobpersonal.*,privatepersonal.*,count(privateperosnal.id) as countprid FROM [privatepersonal],[jobpersonal] WHERE [jobpersonal.jo_prcode]=[privatepersonal.id] and [jobpersonal.joid]='"&a&"' and [privatepersonal.prefixth]='"&n1&"' "
set Rs = Conn.Execute(SQL)
sex1(a)=rs(0)
next
%>