SAK }‘ŠÙ
ASP VB Script Šî‘bŽÀ’n•Ò2 - ƒf[ƒ^ƒx[ƒXŽQÆAÚ‘±AƒNƒGƒŠAƒŠƒXƒgƒAƒbƒv
¡ƒf[ƒ^ƒx[ƒXŽQÆ EŽŸ‚̃eƒXƒgƒe[ƒuƒ‹‚ð€”õ‚µ‚ĉº‚³‚¢B ƒXƒL[ƒ}‚È‚Ç‚ÍA‚²—˜—p‚̊‹«‚ɇ‚킹‚ÄC³‰º‚³‚¢B create table sak.ƒeƒXƒgm ( ƒL[ char(4) primary key, ƒf[ƒ^1 number(9, 0), ƒf[ƒ^2 number(9, 0), ƒf[ƒ^3 number(9, 0) ); insert into sak.ƒeƒXƒgm values ('a001', 101, 201, 301); insert into sak.ƒeƒXƒgm values ('b002', 102, 202, 302); insert into sak.ƒeƒXƒgm values ('c003', 103, 203, 303); insert into sak.ƒeƒXƒgm values ('d004', 104, 204, 304); insert into sak.ƒeƒXƒgm values ('e005', 105, 205, 305); insert into sak.ƒeƒXƒgm values ('f006', 106, 206, 306); commit; EƒeƒXƒgm ‚ð‘SŒƒŠƒXƒgƒAƒbƒv‚·‚é‚É‚ÍAŽŸ‚̂悤‚É‚µ‚Ü‚·B <%@ Language=VBScript %> <% const title = "ƒf[ƒ^ƒx[ƒXŽQÆ" const dsn = "dsn=SAK3_ADO;uid=SAK;pwd=SAK" const dcr = 3 '** adUseClient const dbi = "*" const dbf = "sak.ƒeƒXƒgm" const dbw = "" '** where ƒL[ like 'a%' const dbo = "order by ƒL[" dim sql, rs, i, s '** ƒf[ƒ^ƒx[ƒXÚ‘± if isempty(session("s3cn_ado")) then set session("s3cn_ado") = server.CreateObject ("ADODB.Connection") session("s3cn_ado").Open dsn session("s3cn_ado").CursorLocation = dcr end if '** ƒNƒGƒŠ”s sql = "select " & dbi & " from " & dbf & " " & dbw & " " & dbo set rs = session("s3cn_ado").Execute(sql) %> <HTML> <HEAD> <TITLE><% = title %></TITLE> </HEAD> <BODY> <% '** ƒf[ƒ^ƒŠƒXƒgƒAƒbƒv response.write("<P>”s SQL - " & sql & "</P>") response.write("<P>") i = 0 do until rs.eof i = i + 1 s = right("000000" & i, 6) response.write(s & " Œ–Ú - " & rs("ƒL[") & " " & rs("ƒf[ƒ^1") & " " & rs("ƒf[ƒ^2") & " " & rs("ƒf[ƒ^3") & "<BR>") rs.movenext loop response.write("</P>") '** ƒŒƒR[ƒhƒZƒbƒgƒNƒ[ƒY rs.close %> </BODY> </HTML> Econst dbw ‚ðC³‚·‚é‚ÆA’ŠoðŒ‚ð‚¢‚ë‚¢‚ë‚É•Ï‚¦‚ç‚ê‚Ü‚·B uwhere ƒL[ like 'a%'v‚É‚·‚é‚ÆAuav‚ÅŽn‚Ü‚éƒf[ƒ^‚ª 1 Œ‚¾‚¯A ’Šo•\Ž¦‚³‚ê‚Ü‚·B const dbw = "where ƒL[ like 'a%'" ¡ASP VB Script Šî‘bŽÀ’n•ÒŽ‘—¿
¡ASP VB Script Šî‘b•ÒŽ‘—¿
¡ASP VB Script ADO + SQL ‰ž—p•ÒŽ‘—¿
¡ASP VB Script oo4o + SQL ‰ž—p•ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿