Do you really have the ! in your destination file() test?
I do stuff like this when I'm comparing 2 lookup tables.
IF FILE(lcSource)
USE (lcSource) IN SELECT([source]) ALIAS source
endif
IF FILE(lcDestination)
USE (lcDestination) IN SELECT([destination]) ALIAS destination
ENDIF
The NODATA keyword only applies to SQL views so I don't think that's doing
anything useful for you.
If you're comparing indexes, you might want to check out the ATAGINFO function.
--
rk
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Michael Savage
Sent: Tuesday, May 22, 2012 3:25 PM
To: [email protected]
Subject: Stumbling block... Comparing indexes
I have 2 databases that I wish to compare the tables.
The database can have tables with the same name, however they will be in
different directories.
When I try to open the second table I get this error "file in use"
I need to compare old to new. There are no errors, when I try to compare,
tables, fields, count records. but when I try to compare indexes it blows up
with above error.
Here is a snippet of code I've tried.
*-lcSourceDatabase its tables are stored in the same directory.
*-
lcSource=ADDBS(JUSTpath(lcSourceDatabase)) + lcAlias+'.dbf'
I then trap for it to exist, in case the databases are different and don't hold
the same tables.
if file(lcSource)
USE (lcSource) in 0 ALIAS lcSourceAlias NODATA endif
*- I do the same thing with the destination tables
lcDestination=ADDBS(JUSTpath(lcDestinationDataBase)) + lcAlias+'.dbf'
IF !FILE(lcDestination)
use (lcDestination) in 0 ALIAS lcDestinationAlias NODATA ENDIF
In the destination code, it blows up when I try to open the destination table.
(Error mentioned above.)
How do I force it to open the two different tables, with the same name?
They are in different directories.
Any ideas?
TIA,
Mike
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD0441D52EABCBC@ACKBWDDQH1.artfact.local
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.