Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2005, 09:06 PM
Authorized User
 
Join Date: Dec 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Insert record disabled

My Access db has SQL Svr linked tables, via ODBC data source.
In Access the tables that have foreign keys cannot be edited (no updates, no new records).

The other linked tables can be edited in Access.

If I use SQL Svr Query analyzer on same PC, I can update / insert records in any table.

How do I get Access to be able to edit those tables with foreign keys ??

JKing
__________________
Thanks,
J K
 
Old December 16th, 2005, 01:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Do your non-updateable tables have a primary key field?

 
Old December 16th, 2005, 08:24 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If the "linked tables" are views, you may not be able to update them since they contain more than one table. This can be a limitation in SQL server views.

Also, the credentials your ODBC connection is using may not allow updates/deletes etc. Create another ODBC connection using your sa credentials and see if this helps.

mmcdonal
 
Old December 16th, 2005, 02:41 PM
Authorized User
 
Join Date: Dec 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, the non-updateable tables have a primary key field. And so do the updateable tables.
JK


>>
>> Do your non-updateable tables have a primary key field?
>>
 
Old December 16th, 2005, 02:48 PM
Authorized User
 
Join Date: Dec 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

>>
>>the credentials your ODBC connection is using may not allow updates/deletes etc.
>>

That is what puzzles me -- all the tables are in same SQL Svr db, and Access is linked to those tables thru just one ODBC connection. The tables with foreign keys can't be updated, but the tables that ARE the foreign key links CAN be updated.
Nevertheless, when I return to that system, I'll change the ODBC connection to SQL auth, user sa.

Thanks,

JK
 
Old December 16th, 2005, 02:58 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Are you using views? This will prevent updates when there is more than one table in the view.

mmcdonal
 
Old December 16th, 2005, 03:00 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I also just thought it may be an ANSI SQL standards issue. Access uses ANSI 89, and SQL Server 2000 uses ANSI 92, I think, so some syntax may be causing a problem.

mmcdonal
 
Old December 16th, 2005, 08:04 PM
Authorized User
 
Join Date: Dec 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

>> ...Are you using views? ...

No views yet.

I add SQL Svr views to a system only after the simpler system works with all the queries in Access. Then I can migrate items to SQL Svr for performance and other good reasons. So now Access is linked to SQL tables.

Thanks,
JK
 
Old December 17th, 2005, 05:11 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Ouch, that sort of defeats one of the purposes of working with a SQL back end. If you are pulling ALL of the data anyway (and then using local queries...) I bet that IS slow.

I would suggest, just for giggles, creating one of your queries in SQL Server, and then using the view as the linked object.

I would also do the updates by sending individual updates to the server using code, not linked tables.

mmcdonal
 
Old January 10th, 2006, 04:31 PM
Authorized User
 
Join Date: Dec 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Solution found:
  The SQL Svr table had an ID column type bigint.
Access doesn't recognize bigint, only int.
After the ID column was changed to type int,
in Access - had to delete the linked table and recreate the link.
Now table edits and record inserts are allowed in Access.
:-)

JKing




Thanks,
J K





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert new record using onnotinlist prema Access VBA 2 November 25th, 2008 04:19 PM
Insert new Record priority05 Classic ASP Databases 2 September 6th, 2004 12:26 PM
Insert a record into a Database ersp Classic ASP Basics 3 May 9th, 2004 08:50 PM
Insert new record ID levinho Classic ASP Databases 5 January 14th, 2004 12:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.