D
Dale Fye
Sorry for the cross post, but this behavior is strange enough that I need a
broad cross section of experts to take a look.
I'm running into a strange problem with an Access 2K query. I forgot to
mention during my earlier post that this query is against 2 Oracle tables
that have been linked via and ODBC connection to Access.
The query I'm running essentially does a comparision between the two tables
with the same structure to identify records as being in Table A only, Table
B only, or in both tables with differences in data. If the record is in
both tables and does not have any differences, then it is not returned. It
does this by UNIONing three subqueries (one for each criteria), and seems to
be working properly.
However, when I write code to dump the results of this query into a
temporary table, it doesn't return the same result set as when I run the
query. When the query is run by itself, it might return 2 or 3 records, but
when run using the code below, it might generate 20 or 30 records. When I
look at the tables, the extra records in the temporary table fall into the
"in both tables with no data differences" category (which means they
shouldn't be returned at all). In fact they show up as belonging to one or
the other of the tables, but not both. What is even weirder is that they
are not the only ones that fall into that category.
I'd really appreciate hearing from anyone who has encountered this behavior
before
if TableExists("tbl_New") then
docmd.deleteobj acTable, "tbl_new "
endif
strSQL = "SELECT * INTO tbl_New FROM qry_my_query"
currentd.execute strSQL
broad cross section of experts to take a look.
I'm running into a strange problem with an Access 2K query. I forgot to
mention during my earlier post that this query is against 2 Oracle tables
that have been linked via and ODBC connection to Access.
The query I'm running essentially does a comparision between the two tables
with the same structure to identify records as being in Table A only, Table
B only, or in both tables with differences in data. If the record is in
both tables and does not have any differences, then it is not returned. It
does this by UNIONing three subqueries (one for each criteria), and seems to
be working properly.
However, when I write code to dump the results of this query into a
temporary table, it doesn't return the same result set as when I run the
query. When the query is run by itself, it might return 2 or 3 records, but
when run using the code below, it might generate 20 or 30 records. When I
look at the tables, the extra records in the temporary table fall into the
"in both tables with no data differences" category (which means they
shouldn't be returned at all). In fact they show up as belonging to one or
the other of the tables, but not both. What is even weirder is that they
are not the only ones that fall into that category.
I'd really appreciate hearing from anyone who has encountered this behavior
before
if TableExists("tbl_New") then
docmd.deleteobj acTable, "tbl_new "
endif
strSQL = "SELECT * INTO tbl_New FROM qry_my_query"
currentd.execute strSQL