By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

ODBC connect to invalid PK Index name

Expert 100+
P: 1,240
I'm working with Access 2010, linking to a MS SQL 2008(?) database. I have no write permission in the SQL db, that is no login to use to update that database.

When I try to make a ODBC link to file Prescription.RX I get an error "Prescription.Presription_PK (note the missing 'c' in the name) is an invalid name. Please be sure there are no illegal characters and the name is not too long"

Using design mode in SQL I verified the name of the primary key index matches the name shown in the message. (I can look in design mode, I can't save any changes)

I haven't found the max length allowed yet, but I doubt that's the problem. I think that "." in the primary key index name is the problem.

1. Can anyone verify that is the problem.
2. Is there a way to link to this SQL table with ODBC?

Thanks very much.

Jan 11 '15 #1
Share this Question
Share on Google+
4 Replies

Seth Schrock
Expert 2.5K+
P: 2,951
Are you using a DSN or DSN-less connection?
Jan 11 '15 #2

Expert 100+
P: 1,240
I've tried with a DSN connection. Is there a way to avoid the problem with a DSN-less connection?
Jan 11 '15 #3

Seth Schrock
Expert 2.5K+
P: 2,951
I have never had any problems with either method when connecting directly to a table. It has always just found the PK and been fine. With views, then you have to manually set the PK value. If using the DSN, then a box should appear asking you to select which field is the PK. If you are using the DSN-less connection, then you have to run some SQL code to create the PK. I have done it before, but I don't have it with me at the moment.
Jan 11 '15 #4

Expert 100+
P: 1,240
I've connected to SQL tables countless times but never had a problem til now. I'm going to try a test by setting up a new table and putting a . in the PK index name.

I looked at DSN-less connections last week but didn't try doing it yet. I'll try that this evening.
Jan 11 '15 #5

Post your reply

Sign in to post your reply or Sign up for a free account.