<%
n1 = "ข้าราชการ"
n2 = "พนักงานราชการ"
n3 = "ลูกจ้าง"
SQL = " SELECT count(jo_prcode) FROM [jobpersonal] WHERE [jotype]='"&n1&"' AND [joid]='"&1&"' "
set Rs = Conn.Execute(SQL)
dept1=rs(0)
%>
ปรากฎว่ามี Error ขึ้นมา ผมจะต้องแก้ไขยังไงครับ
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/people/admin_main.asp, line 218, column 88
SQL = " SELECT count(jo_prcode) FROM [jobpersonal] WHERE [jotype]='"&n1&"' AND [joid]='"&1&"' "
<%
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
%>