Subject |
Re: beginappend() Problem Fixed |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Sun, 2 Jul 2023 16:50:47 +0200 |
Newsgroups |
dbase.getting-started |
On 2023/07/01 07:29, Lee Grant wrote:
> Ken and Mervyn,
>
> Further checking the code and then I did a couple of experiments to find
> out something I hadn't realized before about the designer nuances.
>
> If I drop a database table on the designer form, it creates the
> "this.rowset = this.<tablename>.rowset" right in the code of the form
> and in addition it writes the complete filename path into the sql
> statement created by this process.
This "feature" of always including the path with the filename in the
query's SELECT statement is a right royal PITA. :-( It crept in with
dBASE 10 when the query constructor code streamed out by the form
designer for data-related objects was changed so as to be in line with
constructor code streamed out for other objects.
this.WHATEVER1 = new QUERY()
this WHATEVER1.parent = this
with (this.WHATEVER1)
.....
endwith
became
this.WHATEVER1 = new QUERY(this)
with (this.WHATEVER1)
.....
endwith
The "feature" looks to be a half-arsed attempt to accommodate
programmers who believe in keeping tables in a separate folder from
programs.
The Tables tab in the Navigator can be set to access a different folder
from the rest of the tabs. If a named database is selected from the
drop-down list for the Tables tab, dragging a table onto a form creates
both a query and a database object. Perfect.
If a previously selected folder, different to the folder selected for
forms, is selected from the drop-down list including the path with the
filename IS required otherwise the query could not open.
As I see it, to properly implement this "feature", if the Form and
Tables tabs are accessing the same folder the path should NOT be
included with the tablename in the query's SELECT statement. If the
table folder is a subfolder of the form folder then a relative path,
rather than an absolute path, should be included in the query's SELECT
statement.
Mervyn.
|
|