473,785 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error 3027 Help using DAO

5 New Member
I am having a problem with my Database. I am having an issue with being able to update a set of records. What I need is a way to uncheck a checkbox in the underlying table in this query. The # of checkboxes to be unchecked will be different for each customer, so I've been told an SQL query won't work. When I run the following code I get "error 3027 Cannot update. Database or object is read only" It stops at rs.edit

Expand|Select|Wrap|Line Numbers
  1. testString = "SELECT tblTEST.[CustNum], tblTEST.[Month/Year], tblTEST.[Yes/No] " & _
  2.              "FROM tblTEST " & _
  3.              "GROUP BY tblTEST.Field1, tblTEST.[Month/Year], tblTEST.[Yes/No]"
  4.  
  5.         Dim MyDB As DAO.Database
  6.         Dim rs As DAO.Recordset
  7.         Set MyDB = CurrentDb
  8.  
  9. Set rs = CurrentDb.OpenRecordset(testString, dbOpenDynaset, 0,dbOptimistic)
  10.  
  11.         tempBalance = 0
  12.  
  13.         Do
  14.  
  15.             If rs.EOF = False Then
  16.  
  17.                 rs.Edit    'This is where it craps out
  18.                 rs("Yes / NO") = 0
  19.                 rs.Update
  20.  
  21.                 rs.MoveNext
  22.             Else     'last record don't keep moving
  23.                 Exit Do
  24.                 'MsgBox ("exited loop")
  25.             End If
  26.  
  27.         Loop While tempBalance < 3
I have tried using Set rs = MyDB.OpenRecord set(testString, dbOpenDynamic) in place of the current call just to check and it gives me "error 3001 invalid argument". Any help I am lost at this point, Thanks
Feb 9 '07 #1
4 7820
wishwish20
5 New Member
Oops Field1 in the SQL string is CustNum now, forgot to change in post. Still doesn't work though
Feb 9 '07 #2
ADezii
8,834 Recognized Expert Expert
I am having a problem with my Database. I am having an issue with being able to update a set of records. What I need is a way to uncheck a checkbox in the underlying table in this query. The # of checkboxes to be unchecked will be different for each customer, so I've been told an SQL query won't work. When I run the following code I get "error 3027 Cannot update. Database or object is read only" It stops at rs.edit

testString = "SELECT tblTEST.[CustNum], tblTEST.[Month/Year], tblTEST.[Yes/No] FROM tblTEST GROUP BY tblTEST.Field1, tblTEST.[Month/Year], tblTEST.[Yes/No]"

Dim MyDB As DAO.Database
Dim rs As DAO.Recordset
Set MyDB = CurrentDb

Set rs = CurrentDb.OpenR ecordset(testSt ring, dbOpenDynaset, 0,dbOptimistic)

tempBalance = 0

Do

If rs.EOF = False Then

rs.Edit 'This is where it craps out
rs("Yes / NO") = 0
rs.Update

rs.MoveNext
Else 'last record don't keep moving
Exit Do
'MsgBox ("exited loop")
End If

Loop While tempBalance < 3

I have tried using Set rs = MyDB.OpenRecord set(testString, dbOpenDynamic) in place of the current call just to check and it gives me "error 3001 invalid argument". Any help I am lost at this point, Thanks
Any Recordset created by using a GROUP BY Clause is not updateable.
Feb 9 '07 #3
wishwish20
5 New Member
is there any other way?
Feb 9 '07 #4
NeoPa
32,578 Recognized Expert Moderator MVP
Try this SQL instead :
Expand|Select|Wrap|Line Numbers
  1. testString = "SELECT DISTINCT [CustNum],[Month/Year],[Yes/No] " & _
  2.              "FROM tblTEST"
Feb 10 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5717
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ================================================================= Error 19: "CORBAManagerMessages.h", line 4 # Unexpected 'std'. using std::string; ^^^
6
4753
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
4
4463
by: google | last post by:
I am trying to implement form that allows a user to update data in multiple records in a table based on criteria they enter in the form. Because I want to allow some user interaction on a record level, and provide some additional data validation, I'm trying to do it with code instead of an update query. Unfortunately, it's not letting me update the data: I'm getting an error saying the data is read only. The same query statement, when...
0
6018
by: PaulB | last post by:
Hi there, Allthough I searched for previous posts, I was unable to solve my problem. I try to link my front-mdb with an Excel file using the next line DoCmd.TransferSpreadsheet acLink, 8, "TblParameters", "C:\Parameters.xls", True, "" This works perfect for Access 2000, while for Access 2002 and Access 2003 I get error message 3027: cannot update: database or object is read
1
1600
by: Bruce Le Favre | last post by:
I upsized (using Upsize Wizard) ACCESS back end to MSSQL 2000. Front end is still ACCESS. I'm getting error when trying to add or updated a record entry from front end. The error message reads: 'Error # 3027 was generated by DAO.Recordset Cannot update. Database or object is read only.' Thanks for any help.
1
1407
by: Bruce Le Favre | last post by:
I upsized (using Upsize Wizard) ACCESS back end to MSSQL 2000. Front end is still ACCESS. I'm getting error when trying to add or updated a record entry from front end. The error message reads: 'Error # 3027 was generated by DAO.Recordset Cannot update. Database or object is read only.' Thanks for any help.
2
5332
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on python-list@python.org . - Josiah
11
4930
by: loisk | last post by:
(Access 2000/ODBC to MySQL tables) Hi, I am getting the run time erro 3027 and it says that "cannot update: database or object is read only." Does anyone see any errors in my code below? Thanks for the help! My code is outfilename = "ls." & field1 & value1a & "_" & value1b & ".txt" MsgBox "outfilename is " & outfilename
0
9485
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.