.NETGURU
Updatable Query Problem
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oledb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

John Farrell

I can't get this query to work on a live machine but it works fine on my
system.

I want to INSERT a database record. Real easy stuff, but for some reason I
can't get it to work.
I'm pulling my hair our here, maybe I should of been a carpenter.

Here's my relevenet code:
    'Update
    conMain.Open()
    strInsert = "Insert Into sites ( sitename, siteurl, seotype, lastsubmitted,
contactemail ) Values ( ?, ?, ?, ?, ? )"
    cmdInsert = New OleDbCommand( strInsert, conMain )

    cmdInsert.Parameters.Add ( "@sitename" , txtSite_name.Text )
    cmdInsert.Parameters.Add ( "@siteurl" , txtSite_url.Text )
    cmdInsert.Parameters.Add ( "@seotype" , txtSeo_type.Text )
    cmdInsert.Parameters.Add ( "@lastsubmitted" , txtLast_submitted.Text)
    cmdInsert.Parameters.Add ( "@contactemail" , txtContact_email.Text )

    cmdInsert.ExecuteNonQuery()

    'Repopulate
    cmdInsert = New OleDbCommand ( "SELECT * FROM sites ORDER BY site_name
DESC", conMain )
    dtrMain = cmdInsert.ExecuteReader()

    rptSeo.Datasource = dtrMain
    rptSeo.Databind()

    dtrMain.Close
    conMain.Close

    conMain.Close

    txtSite_name.Text = ""
    txtSite_url.Text = ""
    txtSeo_type.Text = ""
    txtLast_submitted.Text = ""
    txtContact_email.Text = ""

The URL that I get the error on:
http://iac.enragedcreations.com

go ahead and try to update the database, and you'll see the error.

And for those of you who want the error now:
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 51:     cmdInsert.Parameters.Add ( "@contactemail" ,
txtContact_email.Text )
Line 52:
Line 53:     cmdInsert.ExecuteNonQuery()
Line 54:
Line 55:     'Repopulate

Source File: d:\gearhost\hostingaccounts\enraged\www\iac\Default.aspx
Line: 53

Stack Trace:

[OleDbException (0x80004005): Operation must use an updateable query.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
+41

System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult) +154
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
+92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +54
ASP.default_aspx.Update_Data(Object s, EventArgs e) in
d:\gearhost\hostingaccounts\enraged\www\iac\Default.aspx:53
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

Thanks all who help me out. I really need this help.

John Farrell, CTO
Enraged Creations
Torrington, CT - Click here to reveal e-mail address
http://www.enragedcreations.com
Online Presence / E-Commerce Developer

Reply to this message...
 
    
Ken Schaefer (VIP)
Check the NTFS permissions on the server. You usually get this error when
the account being used for file/disk access doesn't have permission to write
to the .mdb file.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: And for those of you who want the error now:
: 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 51: cmdInsert.Parameters.Add ( "@contactemail" ,
: txtContact_email.Text )
: Line 52:
: Line 53: cmdInsert.ExecuteNonQuery()
: Line 54:
: Line 55: 'Repopulate
:
:
: Source File: d:\gearhost\hostingaccounts\enraged\www\iac\Default.aspx
: Line: 53

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply to this message...
 
    
Anand Kumar
(Type your message here)

--------------------------------
From: Anand Kumar

I have a similar problem. I am trying to update a row. and getting the error:

Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.

The write permissions have been set and other queries working on the same table works fine
Reply to this message...
 
    
Anand Kumar
(Type your message here)

--------------------------------
From: Anand Kumar

I have a similar problem. I am trying to update a row. and getting the error:

Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.

The write permissions have been set and other queries working on the same table works fine
Reply to this message...
 
    
Hao Peng
Could you tell me how to Check and change the NTFS permissions on the server.

Thank you
Reply to this message...
 
    
Michael Adams
Could you tell me how to Check and change the NTFS permissions on the server.
--------------------------------
From: Michael Adams
Reply to this message...
 
    
selvam kombiah
(Type your message here)

--------------------------------
From: selvam kombiah
use the database version should be new (i.e) like msaccess 2000 or higher
Reply to this message...
 
 
System.Collections.Specialized.NameValueCollection
System.Data.CommandBehavior
System.Data.OleDb.OleDbCommand
System.Data.OleDb.OleDbException
System.EventArgs
System.Web.UI.IPostBackEventHandler
System.Web.UI.Page
System.Web.UI.WebControls.Button




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification