Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Recordset.Edit Problem

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
eajoyce
Asked:
eajoyce
1 Solution
 
ksleungCommented:
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
 
eajoyceAuthor Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now