Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 15th, 2005, 09:06 PM
Authorized User
 
Join Date: Dec 2004
Location: Bakersfield, CA, USA.
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
Reply With Quote
  #2 (permalink)  
Old December 16th, 2005, 01:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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

Reply With Quote
  #3 (permalink)  
Old December 16th, 2005, 08:24 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #4 (permalink)  
Old December 16th, 2005, 02:41 PM
Authorized User
 
Join Date: Dec 2004
Location: Bakersfield, CA, USA.
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?
>>
Reply With Quote
  #5 (permalink)  
Old December 16th, 2005, 02:48 PM
Authorized User
 
Join Date: Dec 2004
Location: Bakersfield, CA, USA.
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
Reply With Quote
  #6 (permalink)  
Old December 16th, 2005, 02:58 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #7 (permalink)  
Old December 16th, 2005, 03:00 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #8 (permalink)  
Old December 16th, 2005, 08:04 PM
Authorized User
 
Join Date: Dec 2004
Location: Bakersfield, CA, USA.
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
Reply With Quote
  #9 (permalink)  
Old December 17th, 2005, 05:11 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #10 (permalink)  
Old January 10th, 2006, 04:31 PM
Authorized User
 
Join Date: Dec 2004
Location: Bakersfield, CA, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:51 AM.


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