网页出错,麻烦高手指点一下
老师让我们做一个注册网页,用到数据库,页面显示正确,但点击提交时出错。<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
Sub Enter_Click(ByVal ByValSender As Object, ByVal E As EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("userinfo.mdb"))
Dim strSql As String
strSql = "Insert Into users(user_name,password,real_name,tel_number,email) Values('" & user_name1.Text & "','" & password1.Text & "','" & real_name1.Text & "'," & tel_number1.Text & "','" & email1.Text & "')"
Dim cmd As New OleDbCommand(strSql, conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
message.Text = "谢谢注册"
End Sub
</script>
<html>
<body>
<h4 align="center">注册页面</h4>
<center>
<form id="Form1" runat="server">
<table>
<tr>
<td>用户名:</td>
<td><asp:Textbox id="user_name1" runat="server"/></td>
</tr>
<tr>
<td>密码:</td>
<td><asp:Textbox id="password1" textmode="Password" runat="server"/></td>
</tr>
<tr>
<td>真实姓名:</td>
<td><asp:Textbox id="real_name1" columns="40" rows="4" runat="server"/></td>
</tr>
<tr>
<td>电话号码:</td>
<td><asp:Textbox id="tel_number1" columns="40" rows="4" runat="server"/>
</td>
<td>电子邮箱:</td>
<td><asp:Textbox id="email1" runat="server"/>
</td>
</tr>
<tr>
<td></td>
<td><asp:button id="Enter" Text=" 提 交 " onClick="Enter_Click" runat="server"/></td>
</tr>
</table>
<asp:Label id="message" runat="server"/>
</form>
</center>
</body>
</html>