主题:帮帮我吧,各位前辈
[em10]各位大X我下面的代码哪里错了?
<%@page language="vb" debug="true"%>
<%@ Import Namespace="System.Date" %>
<%@ Import Namespace="System.Date.OleDb" %>
<Script Language="VB" Runat="Server">
'创建数据集对象,strSQL语句,FileName为数据库文件名
'TableName为数据表名称
Sub Page_Load(Sender As Object ,e as EventArgs)
Dim Conn As New OleDbConnection()
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("Student.mdb")
conn.Open()
'使用Command对象执行SQL命令
Dim sqlstr As String=UPDATE students SET totalscore += 10 WHETE department='计算机'"
Dim cmd As New OleDbcommand(sqlstr,conn) ' 执行Command对象
cmd.ExecteNonQuery()
conn.Close()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>
<%@page language="vb" debug="true"%>
<%@ Import Namespace="System.Date" %>
<%@ Import Namespace="System.Date.OleDb" %>
<Script Language="VB" Runat="Server">
'创建数据集对象,strSQL语句,FileName为数据库文件名
'TableName为数据表名称
Sub Page_Load(Sender As Object ,e as EventArgs)
Dim Conn As New OleDbConnection()
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("Student.mdb")
conn.Open()
'使用Command对象执行SQL命令
Dim sqlstr As String=UPDATE students SET totalscore += 10 WHETE department='计算机'"
Dim cmd As New OleDbcommand(sqlstr,conn) ' 执行Command对象
cmd.ExecteNonQuery()
conn.Close()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>