Question: Operation must use in updateble query? query to update in Access

Answer: This error usually rases when your connection is fetch-only(readonly) in many cases I ot this error .... but the best solution I found is to use recordset for updating tables(instead of using update command on connection object)\nI write a simle example here ... I hope it can be usefull for you.\nthe firs code is very shorter but some times rases that error\n\n1)\nMyConnection.Open "My connection string"\nMyConnection.execute "update MyTable set MyField='New value' where MyFlag='SelectionFlag'"\nMyConnection.Close\n\n2)\n\nMyConnection.Open "My connection string"\nMyRecordset = new ADODB.Recordset\nMyRecordset.cursorlocation=adUseClient\nMyRecordset.LockType=adLockOptimistic\nMyRecordset.open "Select * from MyTable Where MyFlag='SelectionFlag'"\nMyRecordset!MyField="New value"\nMyRecordset.update\nMyRecordset.close\nMyrecordset=Nothing\nMyConnection.Close
This question from the Yahoo Q&A forum is categorized in the topic: Society & Culture