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

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

Access write error on SQL server, even if

  I am currently trying to write a program using Visual Basic 5 to access to a database on SQL server 6.5. It gives me an error saying that Database or object is read only whenever I am want to insert, delete and update a record.
I checked that the database, table and the fields in the table are set to be updatable using the Enterprise Manager.
I thought my program got bugs, so I tried using the Data Form wizard provided by VB5 to create a database form for my database stored in SQL server. But to what i have not expected, the created program also gives me the same error.
I tried connecting to the sql server with Visual Data Manager provided with VB5. I can connect to the database. In the Database Window of VisData Manager, the updatable property of the database and the table is read as true. But I discovered that all the fields' dataupdatable property is set as false even if i have grant all permission rights on the database and objects.
  Please help me... to solve this problem.
0
weekee
Asked:
weekee
1 Solution
 
BenClarkCommented:
A wild guess.
Check for constraints/rules/etc...
0
 
cymbolicCommented:
Your resultsets will be marked not updateable if modifications or inserts would violate any constraints.  Simple examples of this are things like not including foreign key columns in your resultset for insertions, etc.  Once you create relationships and constraints, every column that is involved in a constraint must be included in your resultset so that the database manager can honor your requests and maintain database integrity.  Look closely at the columns and content you are working with.  YOur resultset is being marked not updateable because it's missing something that the server needs to maintain database integrity.
0
 
weekeeAuthor Commented:
I already solved the problem, by including a primary key i can now update,insert,delete any records. Anyway thank you.

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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