各位帮我看看,为什么会提示更新不了数据呢?
ckxp 2003-05-02 02:46:12 <%@ debug="true"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim objConnection As OleDbConnection
Dim objCmd As OleDbCommand
Dim strConnection As String
Dim strSQL As String
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\myprograms\example\ch13\Northwind.mdb"
' Create and open the connection object
objConnection = New OleDbConnection(strConnection)
objConnection.Open()
' set the SQL string
strSQL = "INSERT INTO Employees ( `FirstName` , `LastName` )" & _
" VALUES ( 'Beth' , 'Hart' )"
' Create the Command and set its properties
objCmd = New OleDbCommand(strSQL, objConnection)
' execute the command
objCmd.ExecuteNonQuery() '///////这里提示错误
'提示:Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
lblStatus.Text = "Command run"
End Sub
</script>
<html>
<body>
<h2>Using SQL directly</h2>
<asp:Label id="lblStatus" runat="server"/>
</body>
</html>