HELP! Operation must use an updateable query

Discussion in 'Databases' started by chriscanali, Jul 1, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'm trying to insert rows into an Access database connection. Here's the code i'm using...




    Dim MdbConn As New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" & Server.MapPath("/_database/PreTest.mdb"))


    MdbConn.Open()


    Dim InsertCmd As New OleDbCommand("INSERT INTO PreTest (Username) VALUES ('" & User.Identity.Name & "')", MdbConn)


    InsertCmd.ExecuteNonQuery()





    And when I run it I get...
    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:





    Code:
    Line 62: 
    Line 63:         Dim InsertCmd As New OleDbCommand("INSERT INTO PreTest (Username) VALUES ('" & User.Identity.Name & "')", MdbConn)
    Line 64:         InsertCmd.ExecuteNonQuery()
    Line 65: 
    Line 66:     End Sub

    Any ideas? Thanks!
     
  2. Bruce

    Bruce DiscountASP.NET Staff

  3. Sorry, I posted this question in the ASP.Net and Database forum at the same time (before the other one was answered)
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page