index.aspx
<%@ page language="c#" %>
<%@ import namespace="system.data" %>
<%@ import namespace="system.data.oledb" %>
<script runat="server">
// insert page code here
//
void page_load(){
string db=@"database/data.mdb";
string connstr="provider=microsoft.jet.oledb.4.0;data source="+server.mappath(db)+";";
string sqlcmd="create table ieb_webs(id identity primary key,title varchar(255) default null)";
oledbconnection conn=new oledbconnection(connstr);
conn.open();
oledbcommand olecmd=new oledbcommand(sqlcmd,conn);
olecmd.executenonquery(); //执行sql命令
response.write("数据表建立完成!");
}
conn.close();
conn=null;
olecmd=null;
}
</script>
<html>
<head>
</head>
<body>
<form method="post" runat="server">
<!– insert content here –>
</form>
</body>
</html>
