SAK }‘ŠŲ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠŲEƒJƒtƒF ˆę—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

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‚É‚·‚é‚ƁAuav‚ÅŽ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 ServletAJSP •ŌŽ‘—ŋ
ĄMySQL •ŌŽ‘—ŋ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠŲEƒJƒtƒF ˆę—— SAK Streets ŒŸõ



Copyright (C) 1999-2017 Y.SAK