Data | Database system environment:
1, operating system: Windows 2000
2. Database: Oracle 8i R2 (8.1.6) for NT Enterprise Edition
3, Installation path: C:\ORACLE
Access method:
1, connect to the Sql*plus to System/manager user login,sql> conn system/manager Create new users: such as User1/pass1, give Connect,resource permissions. Sql> Grant Connect,resource to User1 identified by Pass1; Sql> conn user1/pass1sql> CREATE TABLE Test (a date); Instance name of Oracle database, in this case: Oradboracle username, In this example: User1oracle host string: Oradbtnsnames.ora file oradb = (DESCRIPTION = (Address_list = (address = (PROTOCOL = TCP) (host = 192.1.1. 1) (PORT = 1521))) (Connect_data = (service_name = oradb))) 2, create test.asp under the IIS default WWW directory, with notebook edit, enter the following code <%<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, open a browser window, enter the following address to view the results of the operation, you can continue to press the F5 key to refresh the display results http://localhost/test.asp