Error inserting record to Access 2003

A

al

I recieve this error in the browser when I try to insert a
record to a table in Access 2003.

The following is the complete error message.
I am using Visual Studio .Net and creating an ASP page to
insert a record in a table in Access.

Thanks much. Hopefully you can help.

al,


Operation must use an updateable query.
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:
Operation must use an updateable query.

Source Error:


Line 11: cmd = New OleDbCommand(strSql, cn)
Line 12: cn.Open()
Line 13: cmd.ExecuteNonQuery()
Line 14: Return cmd
Line 15: cn.Close()


Source File:
C:\Inetpub\wwwroot\InsertSql\AccessClass.vb Line: 13

Stack Trace:


[OleDbException (0x80004005): Operation must use an
updateable query.]

System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandl
ing(Int32 hr)

System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleR
esult(tagDBPARAMS dbParams, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommandText
(Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommand
(CommandBehavior behavior, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal
(CommandBehavior behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
InsertSql.AccessClass.insert(String strSql) in
C:\Inetpub\wwwroot\InsertSql\AccessClass.vb:13
InsertSql.WebForm1.Button1_Click(Object sender,
EventArgs e) in
C:\Inetpub\wwwroot\InsertSql\WebForm1.aspx.vb:46
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEve
ntHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top