<%@ Import Namespace="System.data"%>
<%@ Import Namespace="System.data.OleDb"%>
<script language="VB" runat="server" >
sub page_load(sender as object,E as EventArgs)
'建立connection对象
dim conn as new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data source=C:\inetpub\wwwroot\asp.net\chapter6\wwwlink.mdb")
'建立command对象
dim cmd as new OleDbCommand("Insert Into link(sitename,URL,intro,grade,submit_date)values('微软主页','www.microsoft.com','微软公司主页,有很多技术文献',5,#" &now()&"#)",conn)
'执行操作,插入记录
conn.open()   '打开数据库
conn.close()   '关闭数据库
message.text="已经成功添加,请自己打开数据库wwwlink.mdb查看结果"
end sub
</script>
<html>
<body>
  <h4 align="center">插入记录</h4>
  <center><asp:label id="message" runat="server"/></center>
</body>
</html>