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 |

PostgreSQL + ASP ADO •Ò1 - ODBC ƒhƒ‰ƒCƒoAƒŒƒR[ƒhXVAƒŒƒR[ƒhŽQÆ

¡PostgreSQL ODBC ƒhƒ‰ƒCƒoƒCƒ“ƒXƒg[ƒ‹

  EVB ‚Æ‹¤’Ê‚Å‚ ‚éB

¡PostgreSQL ODBC ƒVƒXƒeƒ€ DSN Ý’è

  EVB ‚Æ‹¤’Ê‚Å‚ ‚éB

¡PostgreSQL ODBC + ASP VB Script ADO ƒe[ƒuƒ‹ì¬

  Eƒe[ƒuƒ‹ì¬‚ÅA“ú–{Œê€–Ú–¼‚ªŽw’è‚Å‚«‚é‚©ƒeƒXƒg‚·‚éB
    –â‘è‚È‚­ì¬‚Å‚«‚éB

<%@ Language=VBScript %>
<%
  Const title = "PostgreSQL ODBC + ASP VB Script ADO ƒe[ƒuƒ‹ì¬"
  Dim cn
  Dim sql

'** ODBC Ú‘±
  set cn = Server.CreateObject ("ADODB.Connection")
  cn.Open "dsn=PostgreSQL;uid=sak;pwd=sak"
  cn.CursorLocation = 3

'** ƒe[ƒuƒ‹ì¬
  sql = "create table testm ("
  sql = sql & "ƒL[ char(008),"
  sql = sql & "ƒf[ƒ^1 int8,"
  sql = sql & "ƒf[ƒ^2 int8,"
  sql = sql & "ƒf[ƒ^3 int8"
  sql = sql & ")"
  cn.Execute sql

'** ODBC Ú‘±‰ðœ
  cn.Close
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE><% = title %></TITLE>
</HEAD>
<BODY>
<P><% = title %></P>
<P><% = sql %></P>
<P>ˆ—I—¹</P>
</BODY>
</HTML>

¡PostgreSQL ODBC + ASP VB Script ADO ƒŒƒR[ƒhXV

  EƒŒƒR[ƒh’ljÁ‚ÅA“ú–{Œêƒf[ƒ^‚ªŽw’è‚Å‚«‚é‚©ƒeƒXƒg‚·‚éB
    –â‘è‚È‚­’ljÁ‚Å‚«‚éB

<%@ Language=VBScript %>
<%
  Const title = "PostgreSQL ODBC + ASP VB Script ADO ƒŒƒR[ƒhXV"
  Dim cn

'** ODBC Ú‘±
  set cn = Server.CreateObject ("ADODB.Connection")
  cn.Open "dsn=PostgreSQL;uid=sak;pwd=sak"
  cn.CursorLocation = 3

'** ƒgƒ‰ƒ“ƒUƒNƒVƒ‡ƒ“ŠJŽn
  cn.BeginTrans

'** ƒŒƒR[ƒhˆ—
  cn.Execute "insert into testm values ('x001', 1, 2, 3)"
  cn.Execute "insert into testm values ('x002', 10, 20, 30)"
  cn.Execute "insert into testm values ('“ú–{Œê', 1, 2, 3)"
  cn.Execute "insert into testm values ('‚©‚ñ‚¶', 10, 20, 30)"

'** ƒgƒ‰ƒ“ƒUƒNƒVƒ‡ƒ“I—¹
  cn.CommitTrans

'** ODBC Ú‘±‰ðœ
  cn.Close
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE><% = title %></TITLE>
</HEAD>
<BODY>
<P><% = title %></P>
<P>ˆ—I—¹</P>
</BODY>
</HTML>

¡PostgreSQL ODBC + ASP VB Script ADO ƒŒƒR[ƒhŽQÆ

  EƒŒƒR[ƒhŽQÆ‚ÅA“ú–{Œê€–ÚA“ú–{Œêƒf[ƒ^‚ªŽQÆ‚Å‚«‚é‚©ƒeƒXƒg‚·‚éB
    –â‘è‚È‚­ŽQÆ‚Å‚«‚éB

<%@ Language=VBScript %>
<%
  Const title = "PostgreSQL ODBC + ASP VB Script ADO ƒŒƒR[ƒhŽQÆ"
  Dim cn
  Dim rs
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE><% = title %></TITLE>
</HEAD>
<BODY>
<P><% = title %></P>
<%
'** ODBC Ú‘±
  set cn = Server.CreateObject ("ADODB.Connection")
  cn.Open "dsn=PostgreSQL;uid=sak;pwd=sak"
  cn.CursorLocation = 3

'** ƒŒƒR[ƒhƒZƒbƒgƒI[ƒvƒ“
  set rs = cn.Execute("select * from testm")

'** ƒŒƒR[ƒhˆ—
  response.write(rs("ƒL[").name & "<BR>")
  response.write("-------------<BR>")
  do until rs.EOF
    response.write(rs("ƒL[") & "<BR>")
    rs.MoveNext
  loop
  response.write("-------------<BR>")

'** ƒŒƒR[ƒhƒZƒbƒgƒNƒ[ƒY
  rs.Close

'** ODBC Ú‘±‰ðœ
  cn.Close
%>
<P>ˆ—I—¹</P>
</BODY>
</HTML>

¡‚»‚Ì‘¼ ADO ‘€ì

  ESQL ‚É‘½­‚̈Ⴂ‚Í‚ ‚Á‚Ä‚àAADO ‚»‚Ì‚à‚Ì‚Ì‘€ì‚Í Oracle ‚Æ•Ï‚í‚ç‚È‚¢B
    wVB ADO + SQL ‰ž—p•ÒxAwASP VB Script ADO + SQL ‰ž—p•Òx
    ‚ðŽQl‚É‚µ‚ĉº‚³‚¢B

¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿
| 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-2024 Y.SAK