<! version 2.25July46 by burin rujjanapan from yonok.ac.th>
<! doctitle : id, username, title, titledate, detail, url >
<! select.asp?key=10001 >
<! select.asp?key=10004 >
<!--#include file="header.asp"-->
<%
dim connect, rs, sql, ip, f
ip = "10.7.4.31"
set connect = server.createobject("ADODB.Connection")
if request.querystring("key") = "db" then
connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\" & request.querystring("db")
set rs = server.createobject("ADODB.recordset")
sql = request.querystring("sql")
set rs = connect.execute(sql)
response.write("<center><table bgcolor=white cellpadding=3 cellspacing=3 border=0><tr bgcolor=#000080>")
if (len(request.querystring("tf1"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf1") & "</td>") end if
if (len(request.querystring("tf2"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf2") & "</td>") end if
if (len(request.querystring("tf3"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf3") & "</td>") end if
if (len(request.querystring("tf4"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf4") & "</td>") end if
if (len(request.querystring("tf5"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf5") & "</td>") end if
if (len(request.querystring("tf6"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf6") & "</td>") end if
if (len(request.querystring("tf7"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf7") & "</td>") end if
if (len(request.querystring("tf8"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf8") & "</td>") end if
if (len(request.querystring("tf9"))>1) then response.write("<td align=center><font color=white>" & request.querystring("tf9") & "</td>") end if
response.write("</tr>")
i = 1
do while not rs.eof
if (i mod 2) = 0 then
response.write("<tr bgcolor=#ffffdd>")
else
response.write("<tr bgcolor=#dddddd>")
end if
f = request.querystring("f1")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f2")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f3")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f4")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f5")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f6")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f7")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f8")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
f = request.querystring("f9")
if (len(f)>1) then response.write("<td>" & rs(f) & "</td>") end if
response.write("</tr>")
rs.movenext
i = i 1
loop
response.write("</table>")
connect.close
end if
' === 10001
if request.querystring("key") = "10001" then
if Request.ServerVariables("LOCAL_ADDR") = ip then
'connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\dbdoc.mdb"
connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\iftpsvc\lampang-server\users\lampang\dbdoc.mdb"
else
if mid(Request.ServerVariables("URL"),1,9) = "/_private" or mid(Request.ServerVariables("URL"),1,8) = "/thaiall" or mid(Request.ServerVariables("URL"),1,7) = "/select" then
connect.open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &_
Server.MapPath("dbdoc.mdb"))
else
connect.open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &_
Server.MapPath("\thaiprovince\db\dbdoc.mdb"))
end if
end if
set rs = server.createobject("ADODB.recordset")
sql = "select * from doctitle"
set rs = connect.execute(sql)
response.write("<center><table bgcolor=white cellpadding=1 cellspacing=1 border=0><tr bgcolor=#000080>")
response.write("<td><font color=white>ID</td>")
response.write("<td><font color=white>Username</td>")
response.write("<td><font color=white>Title</td>")
response.write("<td><font color=white>Titledate</td></tr>")
i = 1
do while not rs.eof
if (i mod 2) = 0 then
response.write("<tr bgcolor=#ffffdd>")
else
response.write("<tr bgcolor=#dddddd>")
end if
response.write("<td>" & rs("id") & "</td>")
response.write("<td>" & rs("username") & "</td>")
response.write("<td>" & rs("title") & "</td>")
response.write("<td>" & rs("titledate") & "</td>")
response.write("</tr>")
rs.movenext
i = i 1
loop
response.write("</table>")
connect.close
end if
' === 10002
if request.querystring("key") = "10002" then
'connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\dbdoc.mdb"
connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\iftpsvc\lampang-server\users\lampang\dbdoc.mdb"
set rs = server.createobject("ADODB.recordset")
sql = "select * from doctitle"
set rs = connect.execute(sql)
response.write("<center><table bgcolor=white cellpadding=1 cellspacing=1 border=0><tr bgcolor=#000080>")
response.write("<td><font color=white>Username</td>")
response.write("<td><font color=white>Title</td>")
response.write("<td><font color=white>Titledate</td></tr>")
i = 1
do while not rs.eof
if (i mod 2) = 0 then
response.write("<tr bgcolor=#ffffdd>")
else
response.write("<tr bgcolor=#dddddd>")
end if
response.write("<td>" & rs("username") & "</td>")
response.write("<td>" & rs("title") & "</td>")
response.write("<td>" & rs("titledate") & "</td>")
response.write("</tr>")
rs.movenext
i = i 1
loop
response.write("</table>")
connect.close
end if
' === 10003
if request.querystring("key") = "10003" then
'connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\mdb\CEO2_DATA.mdb"
connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\iftpsvc\lampang-server\users\lampang\mdb\CEO2_DATA.mdb"
set rs = server.createobject("ADODB.recordset")
sql = "select * from Amphur"
set rs = connect.execute(sql)
response.write("<center><table bgcolor=white cellpadding=1 cellspacing=1 border=0><tr bgcolor=#000080>")
response.write("<td width=100><font color=white>????????</td>")
response.write("<td><font color=white>????</td></tr>")
i = 1
do while not rs.eof
if (i mod 2) = 0 then
response.write("<tr bgcolor=#ffffdd>")
else
response.write("<tr bgcolor=#dddddd>")
end if
response.write("<td>" & rs("AmpCode") & "</td>")
response.write("<td>" & rs("Amphur") & "</td>")
response.write("</tr>")
rs.movenext
i = i 1
loop
response.write("</table>")
connect.close
end if
' === 10004
if request.querystring("key") = "10004" then
'connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\mdb\per.mdb"
connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\iftpsvc\lampang-server\users\lampang\\mdb\per.mdb"
set rs = server.createobject("ADODB.recordset")
sql = "select * from 1"
set rs = connect.execute(sql)
response.write("<center><table bgcolor=white cellpadding=1 cellspacing=1 border=0><tr bgcolor=#000080>")
response.write("<td width=150 ><font color=white>???</td>")
response.write("<td width=150><font color=white>???????</td>")
response.write("<td width=300><font color=white>?????</td>")
i = 1
do while not rs.eof
if (i mod 2) = 0 then
response.write("<tr bgcolor=#ffffdd>")
else
response.write("<tr bgcolor=#dddddd>")
end if
response.write("<td>" & rs("name") & "</td>")
response.write("<td>" & rs("sur") & "</td>")
response.write("<td>" & rs("tam") & "</td>")
response.write("</tr>")
rs.movenext
i = i 1
loop
response.write("</table>")
connect.close
end if
' === 10005
if request.querystring("key") = "10005" then
'connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\mdb\per.mdb"
connect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\iftpsvc\lampang-server\users\lampang\\mdb\provincedb.mdb"
set rs = server.createobject("ADODB.recordset")
sql = "select * from tumbon42 where amp42_id ='" & request.querystring("d") & "'"
set rs = connect.execute(sql)
response.write("<center>")
response.write(request.querystring("a"))
response.write("<table bgcolor=white cellpadding=1 cellspacing=1 border=0><tr bgcolor=#000080>")
response.write("<td width=150 ><font color=white>????????</td>")
response.write("<td width=150><font color=white>???????</td>")
i = 1
do while not rs.eof
if (i mod 2) = 0 then
response.write("<tr bgcolor=#ffffdd>")
else
response.write("<tr bgcolor=#dddddd>")
end if
response.write("<td>" & rs("tum42_id") & "</td>")
response.write("<td>" & rs("tumbon") & "</td>")
response.write("</tr>")
rs.movenext
i = i 1
loop
response.write("</table>")
connect.close
end if
' ===
set rs = nothing
set connect = nothing
%>
<!--#include file="footer.asp"-->
</body></html>
จำนวน : 230 บรรทัด