2、在IIS默认WWW目录下创建test.asp,用notebook编辑,输入以下代码 <% set conn=server.createobject("adodb.connection") dns="Provider=OraOLEDB.Oracle.1;Persist Security Info=True;User ID=user1;Password=pass1;Data Source=oradb" conn.Open dns
SQL="insert into test(a) values(sysdate)" set rs=conn.execute(SQL)
set rs=nothing conn.close set conn=nothing %>
<% set conn=server.createobject("adodb.connection") dns="Provider=OraOLEDB.Oracle.1;Persist Security Info=True;User ID=user1;Password=pass1;Data Source=oradb" conn.Open dns
SQL="select to_char(a,'hh24:mi:ss') from test" set rs=conn.execute(SQL)
do while (not rs.eof) %>
<%=rs.fields(0).value%>
<% rs.movenext loop
rs.close set rs=nothing conn.close set conn=nothing %>