macro in SQL-SELECT refused in executable ? 
Author Message
 macro in SQL-SELECT refused in executable ?

Can somebody please help me?

I use FoxPro 2.5 with the Distr.Kit.

I wrote an application in which I make use of an
SQL-SELECT statement. In this statement I included
a macro-subst. in order to make it possible to add
further filtering conditions. These conditions are
composed elsewhere in the program and are available
in the FiltCond variable that can have the content:
FiltCond = 'AND File1.Field3 > 100'
or
FiltCond = 'AND File1.Field3 > 100 AND File2.Field4 <= date()'
of
FiltCond = ''  (and LEN(FiltCond)=0)

The SQL-statement I use goes like this:

SELECT File1.Field1, File1.Field2. File3.Field5 ;
     FROM File1, File2, File3 ;
     INTO CURSOR FileX ;
     WHERE File1.Field1 = File2.Field2 ;
        AND File1.Field4 = File3.Field1 ;
        &FiltCond ;
     ORDER BY 2

IF _tally > 0
  SELECT FileX
  BROWSE
ENDIF

etc..

The previous version of my program ran fine. Recently I had
to make some minor adjustments (in labels etc.). In the IDE
is still works fine, but the distributable I made doesn't:
while running the execution halts at the spot of this SELECT
and the message "Feature not available" appears.
I cant figure out why this message does appear now and not
in the previous version.

Does anybody know of an answer or give me a clue of how to make
things run like the are supposed to?

I would be very grateful !!

Jelle Straatsma




Sun, 23 Aug 1998 03:00:00 GMT
 macro in SQL-SELECT refused in executable ?

Quote:
>Can somebody please help me?
>I use FoxPro 2.5 with the Distr.Kit.
>I wrote an application in which I make use of an
>SQL-SELECT statement. In this statement I included
>a macro-subst. in order to make it possible to add
>further filtering conditions. These conditions are
>composed elsewhere in the program and are available
>in the FiltCond variable that can have the content:
>FiltCond = 'AND File1.Field3 > 100'
>or
>FiltCond = 'AND File1.Field3 > 100 AND File2.Field4 <= date()'
>of
>FiltCond = ''  (and LEN(FiltCond)=0)
>The SQL-statement I use goes like this:
> Bla-Bla-Bla
>The previous version of my program ran fine. Recently I had
>to make some minor adjustments (in labels etc.). In the IDE
>is still works fine, but the distributable I made doesn't:
>while running the execution halts at the spot of this SELECT
>and the message "Feature not available" appears.
>I cant figure out why this message does appear now and not
>in the previous version.
>Does anybody know of an answer or give me a clue of how to make
>things run like the are supposed to?
>I would be very grateful !!
>Jelle Straatsma



Ahhhh yes.  A nice bug.  Obviously the piece you changed had a SELECT
statement in it that DID NOT have a macro substution.

At compile time, foxpro does not pull the "stuff" needed to process an
SELECT statement if the SELECT contains a macro substution.

Simply add a fake SELECT statement anywhere in your code.  
Note: It does not have to be executed, just present for the compiler

ie:   proc foxbug_fix
       select * from nothing
       retu



Sun, 23 Aug 1998 03:00:00 GMT
 macro in SQL-SELECT refused in executable ?

Quote:

> I wrote an application in which I make use of an
> SQL-SELECT statement. ...I included
> a macro-subst...

The problem could be that some of the internal functions being called
from the macro-substituted lines aren't used elsewhere in your program.  
FoxPro will try to keep the .exe as small as possible by not including
support for unused functions/commands.  The way around this is to "fool"
the compiler, i.e.:

IF .F.             && This section will never run,
                   && but the compiler will include support for it...
   ? DATE()
   ? LEN("STRING")
ENDIF

Hope this helps,

Sandra A. Lee



Mon, 24 Aug 1998 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. macro expansion of SQL SELECT statement

2. 2.6 Dos Build Executable or Build Executable Extended

3. Select files showing up in executable directory??

4. SQL 6.5 Enterprise Manager refuses to run on SQL 7.0 Server

5. mssearch refuses to index sql-tables event 3036

6. Connection refused on SQL Server 2000

7. SQL Server "connection refused"

8. SQL Server refuse to start

9. SQL Server refuses to delete records

10. Why SQL Agent Refused to run job - error 22022

11. SQL Mail--Even Started,Refuse To Work


 
Powered by phpBB® Forum Software