Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old December 20th, 2002, 02:50 AM
Bimmer Bimmer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 4 Bimmer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Error msg: Operation must use an updateable query

I'm trying to insert data into a database with a web form and I get the message "Operation must use an updateable query" when I try the page using my own web server. When I upload the pages to a ASP.Net hosting service the page works fine. On my own server I've enabled write permissions on the database and database directory and it still doesn't work.<br><br>I'm running windows XP with IIS 5.1 using an MSAccess database.<br><br>Can someone suggest a possible solution please?

Reply With Quote
  #2  
Old December 20th, 2002, 03:06 AM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
Do you have a code snippet so we could see what you are trying to do?<p> </p><p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><br><a href="http://www.dotnetbb.com" target="_blank"><img src="http://www.dotnetbb.com/sigs/dnb_468_static.gif" border="0"></a></p>

Reply With Quote
  #3  
Old December 20th, 2002, 11:22 PM
Bimmer Bimmer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 4 Bimmer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is probably the simplest example of what i'm trying to do. As I said before the code works when I upload it to another server but not when I try to test it on my own.<br>The error occurs when the sever tries to execute the insert into command of the SQL statement on the command "cmd.executeNonQuery()"<br><br><div class="msgQuoteWrap"><div class="msgCode">Sub Button1_Click(sender As Object, e As EventArgs)<br><br>Dim conn as OleDbConnection<br>Dim cmd as OleDbCommand<br><br>' Create Connection using OLEDB<br>conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb"))<br>Dim strSQL as string = "insert into customers (name,address,city,state,zip,country) values ('" & txtname.text & "','" & txtaddress.text & "','" & txtcity.text & "','" & txtstate.text & "','" & txtzip.text & "','" & txtcountry.text & "')"<br>cmd = new OleDbcommand(strSQL,conn)<br><br>' Error Trapping using Try / Catch block<br>Try<br>' Open Connection & execute insert statement<br>conn.Open()<br>cmd.executeNonQuery()<br>conn.close()<br>Catch<br>lblMessage.text = "Database Insertion Failed"<br>exit sub<br>End Try<br><br>lblMessage.text = "Database Insertion Successful"<br>End Sub</div></div>

Reply With Quote
  #4  
Old December 20th, 2002, 11:44 PM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
I ran into a similar problem when I did not have Access installed locally on one of my development servers. Do you have Access installed on the PC you are getting the error on?<p> </p><p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><br><a href="http://www.dotnetbb.com" target="_blank"><img src="http://www.dotnetbb.com/sigs/dnb_468_static.gif" border="0"></a></p>

Reply With Quote
  #5  
Old December 21st, 2002, 02:06 AM
Bimmer Bimmer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 4 Bimmer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, I have Access 2002 installed on my machine. I have no problems reading data from the database only inserting data.

Reply With Quote
  #6  
Old December 22nd, 2002, 05:49 AM
Bimmer Bimmer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 4 Bimmer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've fixed the problem by editing the machine.config file enabling impersonation as directed by the microsoft support site (link below)<br><br>http://support.microsoft.com/default.aspx?scid=kb;en-us;316675<br><br>Thanks for your help anyway.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Error msg: Operation must use an updateable query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway