Trying to fix the error "Record set is not updateable" in access 2007 with a linked SQL table - sql

I am experiencing an issue where I try to enter data into a linked table on Microsoft Access 2007.
I keep getting the message :
The record set is not updateable
I have the table linked with a table in Microsoft SQL Server Management Studio.
Originally it was working well until something happened with the primary keys. Every datatype had a primary key, but at some point all PKs were taken away. I know the issue revolves around the primary keys, but I am not sure what it is exactly.

Related

MS SQL Server - Cannot Create Same Index Name on Different Tables

I am creating indexes on two separate tables in the same Database (MS SQL Server), and I got an error saying that an index already exists.
This error does NOT come up again if I changed index name to another.
Please help. Many Thanks.
Screenshot from Microsoft SQL Server Management Studio
I'd strongly suggest that the visual designer is leading you astray. IIRC, indexes used to have schema-scoped names (back in the 7.0 or 2000 era, I think. Before user/schema separation) and later gained the ability to only need to be unique at an individual table level1.
If you try to create a duplicate index manually, you receive the error:
The operation failed because an index or statistics with name '<name>' already exists on table '<table name>'.
Since that's clearly not the error you're seeing, I strongly suspect that it's old code in the visual designer and yet another reason not to use it.
1Unfortunately, we're in an area where historic documentation from the right period is no longer available from the Microsoft website. It used to be easier to verify these recollections because you could still find the "What's new in SQL Server 2000", etc pages there.

Duplicate Output error when exporting Access query to SharePoint list

I have a number of tables in Access, linked in from SQL Server. From these I've created a simple query that I am trying to export to SharePoint following this guide.
When I run the export I get the following error:
I've assumed the export is conflicting with the enforced Title column in SharePoint lists. The query originally had a column called Title, so I first tried renaming it with an alias. This didn't work so now I've removed that column from the query entirely but I'm still getting this error.
Google hasn't helped, I've managed to find someone with the same issue, but they removed the title column and that worked for them.
What is causing this, and what can be done to fix it, or work around it?
Using
Access 2013 and SharePoint 2010 with a SQL Server 2008 R2 database
So I've solved it:
Access sneds up the tables used in the query, including columns not used in the query.
Because one of the tables had a column called Table it created a conflict.

Invalid Object Name in mssql 2005

We currently have an issue with our MSSQL 2005 database. We've recently undergone a migration from windows server 2003 to 2008. SQL Server has remained as 2005. I'm using SQL Server Management Studio to work on.
All the tables in the database follow the format: [SCHEMA].[TABLE_NAME]
When I enter the SQL:
SELECT * FROM [table_name]
I get the error message: Invalid object name '[table_name]'.
If I type in:
SELECT * FROM [schema].[table_name]
This works fine. The username we log into the database with owns the schema which is prepended to all the table names.
The problem is, we have 3rd party companies which have software which exports data from the database. 2 companies have now tried to run their exporters, however are getting the error 'Invalid object name'. The software is logging in with the username which owns the schema.
My question is exactly the same as this one I've found on the internet:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=99802
However the answer on that question seems to be full of keywords rather than actual sentences which makes it very hard to understand.
If anyone could help, it'd be greatly appreciated.
Many thanks
Phil
Set the default schema for the 3rd party's username to the schema their un-prefixed references should point to:
ALTER USER foo WITH DEFAULT_SCHEMA = [bar];
(This is different from owning the schema.)
And tell them to write software correctly. In SQL Server you should always be specifying the schema name, even if you always use dbo.

Updating SQL server from Access front end

This is pretty new to me. I have an Access database that I was to upsize to a SQL server but to keep the Access front end to make this application available remotely. I have imported the data in the SQL database using SSMA which looks to be fine. However, when adding a new record to the Access frontend, the SQL server is not being updated. Am I missing something? I (think I) have linked the tables together but still not joy.
Any help would be great. Thank you
If the data is being stored, but not on the SQL Server then you almost certainly have not linked the tables correctly.
On your Access front end your starting point should be no tables (unless you have some tables deliberately reserved for the front end for some reason). You then link to the back end tables (because you said 'linked the tables together', I suspect you have copies of the tables still in your front end).
During the linking process, Access will confirm if each link is established successfully.
It sounds like you haven't imported the data from MS Access to SQL yet.
Check out the SQL Server Migration Assistant(SSMA) on how to do that.
http://www.microsoft.com/sqlserver/en/us/product-info/migration-tool.aspx#Access.
First you need to migrate the data to SQL and then you link the data in SQL to MS-Access.
Once the tables are linked appropriately it will update in SQL as it is entered in Access.
To link the tables you need to first setup an ODBC and then in access select external data -> import -> more -> ODBC Database and select "Link to the data source by creating linked tables"
Check out this link: http://www.fontstuff.com/ebooks/free/fsLinkingToSQLServer.pdf to make sure you did it right.
I had this problem before.
Create a primary key for every table you want to edit in Access. set identity specification and Identity increment by 1 or ? (you can find this setting in column properties) Make sure data type for primary key is int.
All boolean value fields should have constraint set to 0 and no null values.

Why would my Access 2007 query suddenly become not updateable?

I have a query in Access 2007. It's worked fine for months, but I'm suddenly getting a "the recordset is not updateable" error. Thinking an error must have been caused by a recent change, I went back to archived versions (that definitley worked) - they're all chucking out the same error. The table itself is updatable; indeed, another query on the same table works just fine. What could have suddenly happened to break my query? Code follows:
SELECT Prospects.Company, Contactnames.*, IIf([Prospects]![Key Contact]=[ContactID],True,False) AS [Key Contact], Prospects.Status
FROM Contactnames INNER JOIN Prospects ON Contactnames.CompanyID=Prospects.ID
WHERE (((Prospects.Status) Not Like "Duplicate"));
Any help would be greatly appreciated. Thanks, Oli.
If you are using linked ODBC tables, you need to include the primary key field(s) from all tables in the query if you want the query to be updateable. Here are some potential "gotchas":
Access may not recognize the primary key fields correctly in a linked ODBC table; often (always?) Access picks the first unique index it finds for a table (based on alphabetical order of index name) and assumes that index is the primary key
adding replication to tables in MS SQL Server (and perhaps other RDBMS's) will add a GUID column with a unique index; along with the above point, this can cause Access to think your linked tables have different primary keys than they really do
Changes made to the design of ODBC linked tables are not automatically reflected in Access; linked ODBC tables can be refreshed via Tools --> Database Utilities --> Linked Table Manager... (among other ways)
The likely reason is that it's not the query that has changed, but the database.
Check that the database file hasn't been write protected. That would cause that error message.