• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1441
  • Last Modified:

MapInfo: Cannot Open Table for Live Access

I have a MS Access 97 SR-2 database with this table:
CREATE TABLE table1 (tab1_id COUNTER CONSTRAINT pk_table2 PRIMARY KEY, descr TEXT);
And this view/ query (named "view1"):
SELECT * FROM table1;

I wish to open a Live Access DBMS connection to view1 in MapInfo, but when I do that, I get this error message: "Cannot Open Table for Live Access. A single key column is required on the table. Unable to open view1."

I did find a few articles that shed a little light on the subject. My conclusion by reading this was that my view/ query needed a unique index in order to be accepted by MapInfo, but I'm not sure if this is possible and have no idea how to do it.

Can somebody help me solving this problem?

Here are the articles I found about the problem, you might find them useful.
http://testdrive.mapinfo.com/techsupp/miprod.nsf/d9c4e33650769aec852566bf00603719/df1d5d1eeeffe351ca256873001f417f?OpenDocument
http://www.mapinfo.com/registration/discussions/thread.jsp?forum=6&thread=1035&message=3338&q=live+access
http://mapinfo:ntok2b@betaftp.mapinfo.com/mapinfo/MI55/mipro55ug.exe (mapinfo Professional 5.5 User's Guide p. 403 "Every table must have a single unique key column")
0
tunheim
Asked:
tunheim
  • 10
  • 8
  • 3
  • +1
1 Solution
 
nico5038Commented:
Your table 1 does have a unique key (tab1_id) when I create it, the problem might be the fact that the table hasn't been filled.

Did you use an INSERT query to append some rows?

Nic;o)
0
 
gandalf94305Commented:
Could it be that your primary key field on "table1" needs to be called "MI_table1" (that's what I gathered from the first article you quoted)?

--g.
0
 
TextReportCommented:
Can you link direct to the table, the article states the view needs the index as in SQL Server and Oracle where you can create indexes on views. This is not possible in Access and although your table has the index the query may not be presenting it to MapInfo when it attaches to the query.

Another point is the name of the unique key, the Primary Key in Access is defaulted to PrimaryKey, MapInfo needs MY_PRINDX, well something like that, it is in the first article.

Cheers, Andrew
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
tunheimAuthor Commented:
nico5038:
The table is filled with a few exaple rows, I just didn't bother to include it in my post.

TextReport:
No, I can't link direct to the table. From my example it seems very silly to use a query, but this is just a testing data base I've made to illustrate the problem and avoid confusion.
0
 
nico5038Commented:
Just a thought, did you try:
SELECT tab1_id  FROM table1;
in your view ?

Nic;o)
0
 
tunheimAuthor Commented:
nico5038: Yes, I did.
0
 
nico5038Commented:
OK, new try:

select tab1_id AS MI_PRINX, * from table1;

Nic;o)
0
 
tunheimAuthor Commented:
gandalf94305: Didn't work. It didn't seem to have any effect.

nico5038: Didn't work. It didn't seem to have any effect.
0
 
tunheimAuthor Commented:
TextReport: What would you do to make Access name the unique index MY_PRINDX instead of PrimaryKey?
0
 
TextReportCommented:
You can go into the table design in Access, bring up the Indexes dialog and rename the index there. I am not sure how or if you can do this in DDL.

Cheers, Andrew
0
 
tunheimAuthor Commented:
TextReport: This is how you'd do it in DDL. Unfortunately neither of these worked.

(naming the PK attribute MI_PRINX)
CREATE TABLE table1 (MI_PRINX COUNTER CONSTRAINT PrimaryKey PRIMARY KEY,
description TEXT);

(naming the unique index MI_PRINX)
CREATE TABLE table1 (tab_id COUNTER CONSTRAINT MI_PRINX PRIMARY KEY,
description TEXT);

(naming the PK attribute and the unique index MI_PRINX)
CREATE TABLE table1 (MI_PRINX COUNTER CONSTRAINT MI_PRINX PRIMARY KEY,
description TEXT);
0
 
nico5038Commented:
Then I guess the "final" step is to drop a Q at mapinfo...

Nic;o)
0
 
tunheimAuthor Commented:
The problem is that the pricing of their support scheme aims for company accounts not student wallets.
0
 
TextReportCommented:
That's me done, I don't know what else to try except, have you still got the alias on the field?

Cheers, Andrew
0
 
tunheimAuthor Commented:
TextReport:
Tried the aliasses. Did no difference.

I've been searching around in some old archives of a MapInfo mailing list, and it seems people have been struggling with this problem before. I'm fearing that there is no sollution to this.
0
 
nico5038Commented:
And what about the "reverse" way.
Just import the mapinfo data into access ?

Nic;o)
0
 
tunheimAuthor Commented:
>And what about the "reverse" way.
>Just import the mapinfo data into access ?

What do you mean?
The data is already in access, I'm using MapInfo as a viewer.
0
 
nico5038Commented:
I mean to "send" the data to mapinfo c.q. to steer mapinfo from access. Does the application take input parameters?

Nic;o)
0
 
tunheimAuthor Commented:
Yes, I guess so. You can even run Basic commands on it (MapBasic).
So you mean to have an external program (like access) to push the data into MapInfo every now and then?
0
 
nico5038Commented:
Yep ;-)

Nic;o)
0
 
nico5038Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
tunheimAuthor Commented:
After fiddling around I agree that this seems to be the only sollution if I want to use Access and MapInfo in this way.

On the other hand, I think I'll rather set up a postgresql server or something.

Thanks for an answer on a difficult question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 10
  • 8
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now