|
| Re: filter rows using a linked table |
 |
Fri, 11 Apr 2008 10:42:35 -070 |
Greg Hill
"Linda C. Baker" <lbaker@sboa.in.gov> wrote in message
news:etGT$u$mIHA.940@news-server...
>I want to print a report and have the rows filtered by a field in another
>table that is linked to the first one.
>
> I was able to create the following sql to do what I wanted and used that
> in my report, but when it is compiled and installed on another computer,
> it gives the error "invalid subscript reference".
>
> Do you know what is causing that error and why it works on 1 computer and
> not another? Is there a better way to do this using a filter function or
> something? Thanks.
>
> 'SELECT Units.SDARFLAG, Lgdblog."YEAR", Lgdblog.COUNTY,
Lgdblog.UNITTYPE,
> Lgdblog.IDNO, Lgdblog.CENSUSARDATE, Lgdblog."100RDATE",
> Lgdblog.SBOAARDATE, Lgdblog.FORMAT, Lgdblog.TA7DATE, Lgdblog.COMMENTS,
> Units.UNITNAME ;
> FROM "L:\ITS\ITS
Office\logodaba\2007lgdb\LGDBLOG.DBF" Lgdblog
> ;
> INNER JOIN "units.dbf" Units ;
> ON (Lgdblog.COUNTY = Units.COUNTY) ;
> AND (Lgdblog.UNITTYPE = Units.UNITTYPE) ;
> AND (Lgdblog.IDNO = Units.IDNO) ;
> WHERE Units.SDARFLAG = TRUE ;
> ORDER BY Lgdblog.COUNTY, Lgdblog.UNITTYPE, Lgdblog.IDNO'
Make sure that the other computer has the BDE setup correctly, the first
thing that comes to mind is LEVEL 5 tables. Any long field would be
returned differently than with LEVEL 7.
invalid subscript reference usually means a bad field name is defined in the
code but not actually in the table.
Greg Hill
|
| Post Reply
|
| filter rows using a linked table |
 |
Fri, 11 Apr 2008 13:44:52 -040 |
I want to print a report and have the rows filtered by a field in another table
that is linked to the first one.
I was able to create the following sql to do what I wanted and used that in my
report, but when it is compiled and installed on another computer, it gives the
error "invalid subscript reference".
Do you know what is causing that error and why it works on 1 computer and not
another? Is there a better way to do this using a filter function or something?
Thanks.
'SELECT Units.SDARFLAG, Lgdblog."YEAR", Lgdblog.COUNTY,
Lgdblog.UNITTYPE, Lgdblog.IDNO, Lgdblog.CENSUSARDATE,
Lgdblog."100RDATE", Lgdblog.SBOAARDATE, Lgdblog.FORMAT,
Lgdblog.TA7DATE, Lgdblog.COMMENTS, Units.UNITNAME ;
FROM "L:\ITS\ITS Office\logodaba\2007lgdb\LGDBLOG.DBF"
Lgdblog ;
INNER JOIN "units.dbf" Units ;
ON (Lgdblog.COUNTY = Units.COUNTY) ;
AND (Lgdblog.UNITTYPE = Units.UNITTYPE) ;
AND (Lgdblog.IDNO = Units.IDNO) ;
WHERE Units.SDARFLAG = TRUE ;
|
| Post Reply
|
| Re: filter rows using a linked table |
 |
Fri, 11 Apr 2008 19:43:12 +020 |
Probably the hard coded path is the problem. You should use a database alias
instead.
Roland
"Linda C. Baker" <lbaker@sboa.in.gov> schrieb im Newsbeitrag
news:etGT$u$mIHA.940@news-server...
>I want to print a report and have the rows filtered by a field in another
>table that is linked to the first one.
>
> I was able to create the following sql to do what I wanted and used that
> in my report, but when it is compiled and installed on another computer,
> it gives the error "invalid subscript reference".
>
> Do you know what is causing that error and why it works on 1 computer and
> not another? Is there a better way to do this using a filter function or
> something? Thanks.
>
> 'SELECT Units.SDARFLAG, Lgdblog."YEAR", Lgdblog.COUNTY,
Lgdblog.UNITTYPE,
> Lgdblog.IDNO, Lgdblog.CENSUSARDATE, Lgdblog."100RDATE",
> Lgdblog.SBOAARDATE, Lgdblog.FORMAT, Lgdblog.TA7DATE, Lgdblog.COMMENTS,
> Units.UNITNAME ;
> FROM "L:\ITS\ITS
Office\logodaba\2007lgdb\LGDBLOG.DBF" Lgdblog
> ;
> INNER JOIN "units.dbf" Units ;
> ON (Lgdblog.COUNTY = Units.COUNTY) ;
> AND (Lgdblog.UNITTYPE = Units.UNITTYPE) ;
> AND (Lgdblog.IDNO = Units.IDNO) ;
> WHERE Units.SDARFLAG = TRUE ;
> ORDER BY Lgdblog.COUNTY, Lgdblog.UNITTYPE, Lgdblog.IDNO'
|
| Post Reply
|
| Re: filter rows using a linked table |
 |
Fri, 11 Apr 2008 22:50:18 -040 |
In article <etGT$u$mIHA.940@news-server>, lbaker@sboa.in.gov says...
> I want to print a report and have the rows filtered by a field in another
table that is linked to the first one.
>
> I was able to create the following sql to do what I wanted and used that in
my report, but when it is compiled and installed on another computer, it gives
the error "invalid subscript reference".
>
> Do you know what is causing that error and why it works on 1 computer and
not another? Is there a better way to do this using a filter function or
something? Thanks.
>
> 'SELECT Units.SDARFLAG, Lgdblog."YEAR", Lgdblog.COUNTY,
Lgdblog.UNITTYPE, Lgdblog.IDNO, Lgdblog.CENSUSARDATE,
Lgdblog."100RDATE", Lgdblog.SBOAARDATE, Lgdblog.FORMAT,
Lgdblog.TA7DATE, Lgdblog.COMMENTS, Units.UNITNAME ;
> FROM "L:\ITS\ITS
Office\logodaba\2007lgdb\LGDBLOG.DBF" Lgdblog ;
> INNER JOIN "units.dbf" Units ;
> ON (Lgdblog.COUNTY = Units.COUNTY) ;
> AND (Lgdblog.UNITTYPE = Units.UNITTYPE) ;
> AND (Lgdblog.IDNO = Units.IDNO) ;
> WHERE Units.SDARFLAG = TRUE ;
> ORDER BY Lgdblog.COUNTY, Lgdblog.UNITTYPE, Lgdblog.IDNO'
>
Linda,
Is this a QUERY object in dBASE PLUS? If so, does it have a .param
value? There could be something missing in relatio to that.
Roland's suggestion to use a BDE alias is very good.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
|
| Post Reply
|
| Re: filter rows using a linked table |
 |
Sat, 12 Apr 2008 08:36:36 +010 |
Linda C. Baker wrote:
> I was able to create the following sql to do what I wanted and used
> that in my report, but when it is compiled and installed on another
> computer, it gives the error "invalid subscript reference".
That sounds like a PLUS error, not a BDE / SQL error. Is is possible
that in a report event handler you are referring to a field that isn't
in the SQL statement because the live data in the compiled environment
is routing execution through a path through a condition that doesn't
apply on your development machine?
Are you using query.rowset onOpen, canOpen event handlers, eg in
codeblocks (especially if you get a bizarre line reference for the
error)? Any beforegetvalues, cangetrows, etc?
|
| Post Reply
|
|
|