我写的段程序代码:
<%@CodePage="936"%>
<%@Import Namespace="System.Data.OLEDB"%>
<%@Import Namespace="System.Data"%>
<html>
<head>
<script language="vb" runat="server">
sub Button1_Click(sender as Object,e as EventArgs)
Dim conn As OledbConnection '声明一个OledbConnection对象
conn=New OledbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("users.mdb"))
Dim Cmd As new oledbCommand()
conn.Open()
Cmd.CommandText="delete from [user] where UserID='Julel'"
'建立Command对象,并且指定SQL语句
Cmd.Connection=conn
Cmd.ExecuteNonQuery()
Cmd=nothing
conn.Close()
Conn=Nothing
end sub
</script>
</head>
<body MS_POSITIONING="GridLayout">
<form runat="server" method="post" >
<asp:Button id="Button1" runat="server" Text="OK" OnClick="Button1_Click" />
</form>
</body>
</html> 编译出错:
异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。
源错误:
|