Fejl ved skrivning til ACCESS DB (Handlingen skal bruge)
Hej,Jeg får følgende fejl:
--------------------------------------------------------------
Handlingen skal bruge en opdaterbar forespørgsel.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Handlingen skal bruge en opdaterbar forespørgsel.
---------------------------------------------------------------
Fejlen opstår ved instruktionen:
myCommand.ExecuteNonQuery();
Felter og tabelnavne er checket.
---------------------------------------------------------------
Koden:
<%@ Page Language="C#" debug = true %>
<%@ Import Namespace="System.Data" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<%
OleDbConnection myConnection = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:\\inetpub\\wwwroot\\iu\\Navne.mdb" );
myConnection.Open();
OleDbCommand myCommand = new OleDbCommand( "Insert INTO Navnetabel ( Navn ) Values ( 'Houmann' )", myConnection );
myCommand.ExecuteNonQuery();
myConnection.Close();
%>
New Record Inserted!