Solved

Recordset.Edit Problem

Posted on 1997-04-02
2
196 Views
Last Modified: 2008-03-17
I have created this recordset with a DataControl in VB5.0.
The form has 5 other DataControls. I have successfully got data from these datacontrols. This is the first time I've tried to update or edit the database.
The datacontrol is not linked or bound to any DBCombo, etc.. control. I want to edit the recordset with data that has been entered into text boxes, etc...
As soon as the program gets to the recordset.edit it gives the following error...

"Run-time error '3027':
Can't update. Database or object is read-only."

The database is Access2.0
All permissions have been granted for everyone, read, write etc.
It is set for multi-user
The DataControls Exclusive and ReadOnly properties are set to false.
I have no Idea what is going on, can you help???
0
Comment
Question by:eajoyce
2 Comments
 
LVL 1

Accepted Solution

by:
ksleung earned 100 total points
ID: 1425021
Check the followings:

1. How do you open the Recordset?  Do you open it as a snapshot which cannot be edited? If so, change it to dynaset.

2. Check the Recordset.Updatabale property at run time.  If it is  false, you cannot edit the database records.  It is very likely that you open the recordset as snapshot.
0
 

Author Comment

by:eajoyce
ID: 1425022
Here is the SQL  code and I checked the type of recordset,  it is  a Dynaset.
I'm wondering as the source for the datacontrol is an SQL query does that have any effect on the Edit???
Also the 'Updateable' property of the recordset is false, what can be causing this???...

SQLQuery = "SELECT DISTINCTROW [Device Details].[Device Name], [Device Details].[Device Model], [Device Details].[Location Index], [Device Details].[IP Address], [Device Details].[MAC Address], [Device Details].[WINS Name], [Device Details].[Ports/Blades of Interest], [Device Details].[Service Contract], [Device Details].[Service Contract Info], [Device Details].[J-Tag Number], [Device Details].[Serial Number], [Device Details].[Purchase Information], [Device Details].[CBR Ticket Number] "
SQLQuery = SQLQuery & "FROM [Device Details] "
SQLQuery = SQLQuery & "WHERE (([Device Details].[Device Name]= '" & CStr(cboDeviceInfo(0).Text) & "' ))"
 
 datDeviceInfo(5).RecordSource = SQLQuery
 datDeviceInfo(5).Refresh

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now