Subject Re: Programs and SQL\'s won\'t work
From Ruth Bromer <ruth@treklite.com>
Date Fri, 21 Jun 2019 14:52:44 -0400
Newsgroups dbase.getting-started
Attachment(s) AmountDue.sql

I removed the DBE aliases and entered ARDF_Champs using dbase and the link to the directory with the project.

Then I added  --DATABASE:ARDF_Champs to the first line in one of the SQL\'s.  I didn\'t get an error message when I ran the SQL but it didn\'t do anything either. When I tried to look at the SQL through the design mode, I get the following message.

Error: Unallowed phrase/keyword in command:
:ARDF_Champs

Here is the code for the SQL.  Maybe I entered something wrong.

--DATABASE:ARDF_Champs
SELECT First, Last, TotalFee,   (Last || \', \')  || First  Name, AmtPaid,  TotalFee - AmtPaid  AmtDue,   (First || \' \')  || Last  FullName FROM Competitor WHERE   (TotalFee - AmtPaid)  <> 0  ORDER BY Name  


Mervyn Bick Wrote:


> On 2019-06-21 3:40 PM, Ruth Bromer wrote:
>
> > I have no idea what an ADO is.
>
> The BDE (Borland Database Engine) is the program dBASE uses to actually
> read and write to .dbf files.  ADO (ActiveX Database Objects) is another
> way of accessing data that doesn\'t rely on the BDE.  It is mainly used
> with SQL servers.  It is not applicable for what you are doing.  I only
> mentioned it because you mentioned Connection Aliases which are used for
> ADO connections.
>
> >> Open each .sql file in the sourcecode editor. Enter
> >> --DATABASE:Your_Alias  as the first line.  Save the file and then test
> >> it by double-clicking on it\'s icon in the Navigator.
> >
> > I think I understand what you are saying here but not sure.  Is the alias any name I want to enter or is it the project name?
>
> You can use anything you like but it is better to use something that
> makes sense to you.  Avoid spaces. Use underscore characters if you feel
> this makes it more readable.  Perhaps something like Annual_event or
> Summer_event or Winter_event for the alias.  If you only do one event a
> year you could even use Event as the alias.  The alias is not case
> sensitive so upper case, lower case or any mixture to suit yourself.
>
> Once you have created the alias (let\'s assume you did use Annual_event)
> you can edit your .sql files and place --DATABASE:Annual_event as the
> top line.
>
> This year you set the path for the User BDE Alias to point to, say, the
> folder C:\\event_2019_data  Next year you create a new folder, say,
> c:\\event_2020_data and all you have to do is change the path in the
> alias.  Your code will work without you having to edit anything.
>
> Mervyn.
>
>