資料|資料庫 系統內容:
1、作業系統:Windows 2000
2、資料庫: Oracle 8i R2 (8.1.6) for NT 企業版
3、安裝路徑:C:\ORACLE
存取方法:
1、連入SQL*Plus以system/manager使用者登入,SQL> conn system/manager建立新的使用者:如user1/pass1,賦予connect,resource許可權。SQL> grant connect,resource to user1 identified by pass1;SQL> conn user1/pass1SQL> create table test(a date);Oracle資料庫的執行個體名,本例:oradbOracle使用者名稱,本例:user1Oracle主機字串:oradbtnsnames.ora檔案中ORADB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.1.1.1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = oradb) ) )2、在IIS預設WWW目錄下建立test.asp,用notebook編輯,輸入以下代碼<%<br>set conn=server.createobject("adodb.connection")<br>dns="Provider=OraOLEDB.Oracle.1;Persist Security Info=True;User ID=user1;Password=pass1;Data Source=oradb"<br>conn.Open dns<br><br>SQL="insert into test(a) values(sysdate)"<br>set rs=conn.execute(SQL)<br><br>set rs=nothing<br>conn.close<br>set conn=nothing<br>%><br><br><%<br>set conn=server.createobject("adodb.connection")<br>dns="Provider=OraOLEDB.Oracle.1;Persist Security Info=True;User ID=user1;Password=pass1;Data Source=oradb"<br>conn.Open dns<br><br>SQL="select to_char(a,'hh24:mi:ss') from test"<br>set rs=conn.execute(SQL)<br><br>do while (not rs.eof)<br>%><br><table border=1><br><tr><td><%=rs.fields(0).value%></font></td><br></tr><br><%<br>rs.movenext<br>loop<br><br>rs.close<br>set rs=nothing<br>conn.close<br>set conn=nothing<br>%><br>3、開啟一個瀏覽器視窗,輸入以下地址來查看運行結果,可以通過不斷的按F5鍵來重新整理顯示結果http://localhost/test.asp