Solved

Recordset.Edit Problem

Posted on 1997-04-02
2
192 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

14 Experts available now in Live!

Get 1:1 Help Now