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

#Deleted displaying for ODBC linked tables

P: n/a
Joe
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource
(using Oracle ODBC drivers). After linking the tables in Access, I inspect
the data contained in the linked tables. For tables that involve a number
field as the primary key, the data is returned successfully. For tables
that involve a character field (e.g. CHAR(3) or VARCHAR(10)) as the primary
key, I have the correct number of rows returned, but the data displayed in
all the fields is "#Deleted". I have a colleague who does not seem to have
the same problem I do, and I have not been able to see any differences
between his machine and my machine. We use the same versions of software and
drivers. Jet is version 4.0.8618.0 on both machines

Any help in resolving this would be great.

An example follows:

In Oracle I run the following:

CREATE TABLE anzsic (
Code char(3) NOT NULL,
Descr varchar2(255) NOT NULL
);
ALTER TABLE anzsic ADD (CONSTRAINT anzsic_pk PRIMARY KEY (Code)) ;
INSERT INTO anzsic (code, descr) VALUES ('010','Agriculture, Forestry,
Fishing');
INSERT INTO anzsic (code, descr) VALUES ('020','Mining');
INSERT INTO anzsic (code, descr) VALUES ('030','Manufacturing');
INSERT INTO anzsic (code, descr) VALUES ('040','Electricity, Gas, Water');

In Access I link the tables successfully, and then double click on the
linked table "anzsic" to display the content. I have the following
returned:

CODE DESCR
=================
#Deleted #Deleted
#Deleted #Deleted
#Deleted #Deleted
#Deleted #Deleted

Thanks for any help.

Joe
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Joe wrote:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource
(using Oracle ODBC drivers). After linking the tables in Access, I inspect
the data contained in the linked tables. For tables that involve a number
field as the primary key, the data is returned successfully.


IS this the issue? I have experienced exactly this situation when an
Oracle data type will not translate across the ODBC/Jet interface. In
my case it's been largely when an App I administer has Oracle date
fields with just time and no date in them.

What I've done and counseled other users of the maintenance app I
administer to do is to create the query "gradually". This means
bringing the linked tables into the query grid, linking them and bring
down ONE field at a time. Run the query. If you get data then go back
to design and bring down ONE more field. Repeat until you get the
extremely irritating #Deleted result and you'll know the culprit.
Construct queries omitting the incompatible field(s).

If you have users who want to be able to access the Oracle tables at
will, consider creating an Oracle view that does not have the "bad"
columns and have them link to that instead.

I find it works best to have a Oracle user with grant select (and
possibly other grant privileges depending on the tables/views included)
that users who want to do ODBC stuff to access.

The other bit of advice is to not bother using linked tables. Depending
on the number and nature of Jet joins performed, I've found, in my
Oracle app at least, that with 5 or more tables in an Access Jet query,
you run the danger of the results dropping data for whole columns. Use
pass through queries instead. I use DAO to create various PTQ for list
and combo box data sources, Access form recordsources and so on. In the
latter, it's great because you can apply filters to the long data type
if you have it in your Oracle table.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #2

P: n/a
Joe
Thanks Tim,

I have actually tried what you say, but the problem IS with the primary key
field or unique index (not exactly sure which is most accurate to use in
this case). As I said, I have a colleague who is able to link the tables
without any probs, and I try EXACTLY the same thing on my comp but it
doesn't work :(.

I know that linked tables aren't the best and that I can use pass through
queries. However, pass through queries are not updateable ... so I would
have to built views at Oracle and link them anyway (a layer of indirection I
would prefer not to have to go through).

I did a bit more playing around and find that if I build an Access query
based on the culprit table, regardless of which fields I select, I still
experience the same problem. However, if I add a "distinct" keyword into
the query, problem goes away. i.e. SELECT DISTINCT CODE, DESCR FROM ANZSIC.

Mind you, I know that adding "distinct" results in a sort and possible
slowness and would much prefer not to have to use it. Also, a query/view
built using the "distinct" keyword is not updateable, so it doesn't help me
anyway.

I'm still a little stumped

Thanks
Joe

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cp**********@coranto.ucs.mun.ca...
Joe wrote:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource
(using Oracle ODBC drivers). After linking the tables in Access, I
inspect the data contained in the linked tables. For tables that involve
a number field as the primary key, the data is returned successfully.


IS this the issue? I have experienced exactly this situation when an
Oracle data type will not translate across the ODBC/Jet interface. In my
case it's been largely when an App I administer has Oracle date fields
with just time and no date in them.

What I've done and counseled other users of the maintenance app I
administer to do is to create the query "gradually". This means bringing
the linked tables into the query grid, linking them and bring down ONE
field at a time. Run the query. If you get data then go back to design
and bring down ONE more field. Repeat until you get the extremely
irritating #Deleted result and you'll know the culprit. Construct queries
omitting the incompatible field(s).

If you have users who want to be able to access the Oracle tables at will,
consider creating an Oracle view that does not have the "bad" columns and
have them link to that instead.

I find it works best to have a Oracle user with grant select (and possibly
other grant privileges depending on the tables/views included) that users
who want to do ODBC stuff to access.

The other bit of advice is to not bother using linked tables. Depending
on the number and nature of Jet joins performed, I've found, in my Oracle
app at least, that with 5 or more tables in an Access Jet query, you run
the danger of the results dropping data for whole columns. Use pass
through queries instead. I use DAO to create various PTQ for list and
combo box data sources, Access form recordsources and so on. In the
latter, it's great because you can apply filters to the long data type if
you have it in your Oracle table.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto

Nov 13 '05 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

IDEA 1:

It may be possible that Access is not recognizing the primary key/unique
index on the Oracle table. In that case you can create PK/unique index
in access for the linked table - just be sure you are creating the
PK/index for the real PK/index on the Oracle table. E.g.: Oracle table
has ManagerID as the PK. In an Access query SQL view do this:

ALTER TABLE table_name ADD CONSTRAINT PK_table_name PRIMARY KEY
(ManagerID)

Run that, then check the design view of the linked Oracle table. There
should be a primary key icon on the ManagerID column.

You can do the same thing for a unique index:

CREATE UNIQUE INDEX idx_Index_name ON table_name (column_name)

See the Access Help articles on ALTER TABLE and CREATE INDEX for more
info.

IDEA 2:

In some linked SQL Server tables I had the same problem. Changed the
driver to most recent & problem went away. The Oracle driver may be out
of date. Get the most recent driver for the Oracle db version.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQbePAYechKqOuFEgEQJEtgCfeKMOOsaqzLvME5uVD5MyeN qJEdEAnjfI
tFGr5nBr5tg8P65pCI3br678
=/3ky
-----END PGP SIGNATURE-----
Joe wrote:
Thanks Tim,

I have actually tried what you say, but the problem IS with the primary key
field or unique index (not exactly sure which is most accurate to use in
this case). As I said, I have a colleague who is able to link the tables
without any probs, and I try EXACTLY the same thing on my comp but it
doesn't work :(.

I know that linked tables aren't the best and that I can use pass through
queries. However, pass through queries are not updateable ... so I would
have to built views at Oracle and link them anyway (a layer of indirection I
would prefer not to have to go through).

I did a bit more playing around and find that if I build an Access query
based on the culprit table, regardless of which fields I select, I still
experience the same problem. However, if I add a "distinct" keyword into
the query, problem goes away. i.e. SELECT DISTINCT CODE, DESCR FROM ANZSIC.

Mind you, I know that adding "distinct" results in a sort and possible
slowness and would much prefer not to have to use it. Also, a query/view
built using the "distinct" keyword is not updateable, so it doesn't help me
anyway.

I'm still a little stumped

Thanks
Joe

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cp**********@coranto.ucs.mun.ca...
Joe wrote:

I am using Access 2003 and are linking to an Oracle 9i ODBC datasource
(using Oracle ODBC drivers). After linking the tables in Access, I
inspect the data contained in the linked tables. For tables that involve
a number field as the primary key, the data is returned successfully.


IS this the issue? I have experienced exactly this situation when an
Oracle data type will not translate across the ODBC/Jet interface. In my
case it's been largely when an App I administer has Oracle date fields
with just time and no date in them.

What I've done and counseled other users of the maintenance app I
administer to do is to create the query "gradually". This means bringing
the linked tables into the query grid, linking them and bring down ONE
field at a time. Run the query. If you get data then go back to design
and bring down ONE more field. Repeat until you get the extremely
irritating #Deleted result and you'll know the culprit. Construct queries
omitting the incompatible field(s).

If you have users who want to be able to access the Oracle tables at will,
consider creating an Oracle view that does not have the "bad" columns and
have them link to that instead.

I find it works best to have a Oracle user with grant select (and possibly
other grant privileges depending on the tables/views included) that users
who want to do ODBC stuff to access.

The other bit of advice is to not bother using linked tables. Depending
on the number and nature of Jet joins performed, I've found, in my Oracle
app at least, that with 5 or more tables in an Access Jet query, you run
the danger of the results dropping data for whole columns. Use pass
through queries instead. I use DAO to create various PTQ for list and
combo box data sources, Access form recordsources and so on. In the
latter, it's great because you can apply filters to the long data type if
you have it in your Oracle table.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto


Nov 13 '05 #4

P: n/a
Joe
Thanks MGFoster,

I've checked that Access recognises the PK and it does in these cases ... so
knocks that on the head :(

I did more playing around and dropped any unique indexes and PKs on the
culprit tables in Oracle. I then relinked the table in Access. And ... it
works, I can see the data. Great, but this is not a solution, as we do need
PKs and unique indexes on our tables. So I reapplied the PK, and the
problem came back. I also tried just applying a unique index on the field
that should have been the PK (i.e. Code), without implementing the PK.
Problem also shows up in this case.

So, I am pretty sure that the unique index on a char or varchar2 field is
the thing causing all this. But still no real solution.

Any other suggestions?

Thanks
Joe
"MGFoster" <me@privacy.com> wrote in message
news:ia*****************@newsread3.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

IDEA 1:

It may be possible that Access is not recognizing the primary key/unique
index on the Oracle table. In that case you can create PK/unique index
in access for the linked table - just be sure you are creating the
PK/index for the real PK/index on the Oracle table. E.g.: Oracle table
has ManagerID as the PK. In an Access query SQL view do this:

ALTER TABLE table_name ADD CONSTRAINT PK_table_name PRIMARY KEY
(ManagerID)

Run that, then check the design view of the linked Oracle table. There
should be a primary key icon on the ManagerID column.

You can do the same thing for a unique index:

CREATE UNIQUE INDEX idx_Index_name ON table_name (column_name)

See the Access Help articles on ALTER TABLE and CREATE INDEX for more
info.

IDEA 2:

In some linked SQL Server tables I had the same problem. Changed the
driver to most recent & problem went away. The Oracle driver may be out
of date. Get the most recent driver for the Oracle db version.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQbePAYechKqOuFEgEQJEtgCfeKMOOsaqzLvME5uVD5MyeN qJEdEAnjfI
tFGr5nBr5tg8P65pCI3br678
=/3ky
-----END PGP SIGNATURE-----
Joe wrote:
Thanks Tim,

I have actually tried what you say, but the problem IS with the primary
key field or unique index (not exactly sure which is most accurate to use
in this case). As I said, I have a colleague who is able to link the
tables without any probs, and I try EXACTLY the same thing on my comp but
it doesn't work :(.

I know that linked tables aren't the best and that I can use pass through
queries. However, pass through queries are not updateable ... so I would
have to built views at Oracle and link them anyway (a layer of
indirection I would prefer not to have to go through).

I did a bit more playing around and find that if I build an Access query
based on the culprit table, regardless of which fields I select, I still
experience the same problem. However, if I add a "distinct" keyword into
the query, problem goes away. i.e. SELECT DISTINCT CODE, DESCR FROM
ANZSIC.

Mind you, I know that adding "distinct" results in a sort and possible
slowness and would much prefer not to have to use it. Also, a query/view
built using the "distinct" keyword is not updateable, so it doesn't help
me anyway.

I'm still a little stumped

Thanks
Joe

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cp**********@coranto.ucs.mun.ca...
Joe wrote:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource
(using Oracle ODBC drivers). After linking the tables in Access, I
inspect the data contained in the linked tables. For tables that
involve a number field as the primary key, the data is returned
successfully.

IS this the issue? I have experienced exactly this situation when an
Oracle data type will not translate across the ODBC/Jet interface. In my
case it's been largely when an App I administer has Oracle date fields
with just time and no date in them.

What I've done and counseled other users of the maintenance app I
administer to do is to create the query "gradually". This means bringing
the linked tables into the query grid, linking them and bring down ONE
field at a time. Run the query. If you get data then go back to design
and bring down ONE more field. Repeat until you get the extremely
irritating #Deleted result and you'll know the culprit. Construct queries
omitting the incompatible field(s).

If you have users who want to be able to access the Oracle tables at
will, consider creating an Oracle view that does not have the "bad"
columns and have them link to that instead.

I find it works best to have a Oracle user with grant select (and
possibly other grant privileges depending on the tables/views included)
that users who want to do ODBC stuff to access.

The other bit of advice is to not bother using linked tables. Depending
on the number and nature of Jet joins performed, I've found, in my Oracle
app at least, that with 5 or more tables in an Access Jet query, you run
the danger of the results dropping data for whole columns. Use pass
through queries instead. I use DAO to create various PTQ for list and
combo box data sources, Access form recordsources and so on. In the
latter, it's great because you can apply filters to the long data type if
you have it in your Oracle table.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto



Nov 13 '05 #5

P: n/a
Joe wrote:
Thanks MGFoster,

I've checked that Access recognises the PK and it does in these cases ... so
knocks that on the head :(

I did more playing around and dropped any unique indexes and PKs on the
culprit tables in Oracle. I then relinked the table in Access. And ... it
works, I can see the data. Great, but this is not a solution, as we do need
PKs and unique indexes on our tables. So I reapplied the PK, and the
problem came back. I also tried just applying a unique index on the field
that should have been the PK (i.e. Code), without implementing the PK.
Problem also shows up in this case.

So, I am pretty sure that the unique index on a char or varchar2 field is
the thing causing all this. But still no real solution.

Any other suggestions?


Just the drivers - see if they are same version on PC that works.
Otherwise, ya got me!

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #6

P: n/a
MGFoster wrote:
Just the drivers - see if they are same version on PC that works.
Otherwise, ya got me!


That's what I would suggest as well. Also are you use the MS Oracle
driver (I don't but I know of people who do with no problem) or the
Oracle driver?

We're using 8i and still have machines with 7.3.4 Oracle drivers. So
far, so good.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #7

P: n/a
Joe
Thanks all!

Well, I have tried going back to an earlier Oracle ODBC driver (9.0.1.2.0)
and the problem does seem to go away ... so I'm keeping my fingers crossed
that we don't have to use a newer version of the Oracle driver when we
deploy our Access application via a citrix environment in a few months time.

Thanks for all your suggestions. Glad to have this one nutted out.

Cheers
Joe

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cp**********@coranto.ucs.mun.ca...
MGFoster wrote:
Just the drivers - see if they are same version on PC that works.
Otherwise, ya got me!


That's what I would suggest as well. Also are you use the MS Oracle
driver (I don't but I know of people who do with no problem) or the Oracle
driver?

We're using 8i and still have machines with 7.3.4 Oracle drivers. So far,
so good.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto

Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.