Ho provato a inserire questo semplicissimo script il codice dovrebbe essere corretto e mi dà lo stesso errore.

Ecco il codice

<%@ Language="VB" debug="true" %>
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<script language="VB" runat="server">
Sub InserisciNome(obj as object, e as eventargs)
'Ora devo effettuare l'inserimento
'per prima cosa creo la connessione
dim Conn as new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\aspnet\michele\mdb-database\prova.mdb")
dim sqlstring as string = "insert into utenti (nome) values ('" & nome.text & "') "
'ora devo eseguire il comando
dim objCmd as new OleDbCommand
objCmd.Connection = Conn
objCmd.CommandText = sqlstring
objCmd.Connection.Open()
objCmd.ExecuteNonquery()
objCmd.Connection.Close()
End Sub
</script>
<html>
<head>
<title>visualizzazione</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
</head>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<asp:textbox id="nome" runat="server" />
<asp:button id="btsubmit" runat="server" text="Inserisci il nome" onclick="InserisciNome" />
</form>
</body>
</html>


Ed ecco il solito errore


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: Unknown

Line 14: objCmd.CommandText = sqlstring
Line 15: objCmd.Connection.Open()
Line 16: objCmd.ExecuteNonquery() <-- riga rossa
Line 17: objCmd.Connection.Close()



Datemi una mano per piacere non so più cosa fare , questo errore si verifica anche quando effettuo un update oppure un delete