VFP 8 SP1 on XP Pro SP1

This is the most bizarre thing I've seen in a long time. I had some
code in a form that constructed a SQL SELECT statement as a string,
then runs the command via macro substituion (&). This was working fine.

I decided to move this code into a class. Now, when the macro
substitution line is executed, nothing happens. Here is the string
that is supposed to be executed:

SELECT Employee_name AS fld1, UPPER(Employee_name), Ssn AS fld2, UPPER(Ssn),
Employee_id AS fld3, UPPER(Employee_id), Dob AS fld4, UPPER(Dob) INTO CURSOR
rptCurs FROM empGrpCurs ORDER BY 2, 4, 6, 8

The source cursor (empGrpCurs) exists and contains data. After
this instruction is executed (or not executed in this case), the
destination cursor (rptCurs) does not exist and _TALLY has not been
updated from the prior value. No error is raised. It's like this
instruction never happened. I then placed the actual SQL SELECT
statement (rather than the macro version) in this same method a
few lines lower and the result was exactly the same - no error,
no cursor created, _TALLY unchanged.

I'm convinced I'm just missing something very obvious, but lack
of sleep must be blinding me.

Any ideas?

-- TRW
_______________________________________
t r w 7
at
i x dot n e t c o m dot c o m
_______________________________________

Re: SQL SELECT is not executing by John

John
Fri May 06 14:13:20 CDT 2005

Hey Tim,

Any chance it's an error handler that doesn't give you any visible feedback?

- John

"Tim Witort" <trw7at@ixdot.netcomdotcom> wrote in message
news:Xns964E7A83ABE89timwitortwrotethis@207.217.125.201...
> VFP 8 SP1 on XP Pro SP1
>
> This is the most bizarre thing I've seen in a long time. I had some
> code in a form that constructed a SQL SELECT statement as a string,
> then runs the command via macro substituion (&). This was working fine.
>
> I decided to move this code into a class. Now, when the macro
> substitution line is executed, nothing happens. Here is the string
> that is supposed to be executed:
>
> SELECT Employee_name AS fld1, UPPER(Employee_name), Ssn AS fld2,
> UPPER(Ssn),
> Employee_id AS fld3, UPPER(Employee_id), Dob AS fld4, UPPER(Dob) INTO
> CURSOR
> rptCurs FROM empGrpCurs ORDER BY 2, 4, 6, 8
>
> The source cursor (empGrpCurs) exists and contains data. After
> this instruction is executed (or not executed in this case), the
> destination cursor (rptCurs) does not exist and _TALLY has not been
> updated from the prior value. No error is raised. It's like this
> instruction never happened. I then placed the actual SQL SELECT
> statement (rather than the macro version) in this same method a
> few lines lower and the result was exactly the same - no error,
> no cursor created, _TALLY unchanged.
>
> I'm convinced I'm just missing something very obvious, but lack
> of sleep must be blinding me.
>
> Any ideas?
>
> -- TRW
> _______________________________________
> t r w 7
> at
> i x dot n e t c o m dot c o m
> _______________________________________



Re: SQL SELECT is not executing by trw7at

trw7at
Fri May 06 16:17:07 CDT 2005

John Spiegel seemed to utter in
news:ujUaC7mUFHA.3312@TK2MSFTNGP09.phx.gbl:

> "Tim Witort" <trw7at@ixdot.netcomdotcom> wrote in message
> news:Xns964E7A83ABE89timwitortwrotethis@207.217.125.201...
>> VFP 8 SP1 on XP Pro SP1
>>
>> This is the most bizarre thing I've seen in a long time. I had some
>> code in a form that constructed a SQL SELECT statement as a string,
>> then runs the command via macro substituion (&). This was working
>> fine.
>>
>> I decided to move this code into a class. Now, when the macro
>> substitution line is executed, nothing happens. Here is the string
>> that is supposed to be executed:
>>
>> SELECT Employee_name AS fld1, UPPER(Employee_name), Ssn AS fld2,
>> UPPER(Ssn),
>> Employee_id AS fld3, UPPER(Employee_id), Dob AS fld4, UPPER(Dob) INTO
>> CURSOR
>> rptCurs FROM empGrpCurs ORDER BY 2, 4, 6, 8
>>
>> The source cursor (empGrpCurs) exists and contains data. After
>> this instruction is executed (or not executed in this case), the
>> destination cursor (rptCurs) does not exist and _TALLY has not been
>> updated from the prior value. No error is raised. It's like this
>> instruction never happened. I then placed the actual SQL SELECT
>> statement (rather than the macro version) in this same method a
>> few lines lower and the result was exactly the same - no error,
>> no cursor created, _TALLY unchanged.
>>
>> I'm convinced I'm just missing something very obvious, but lack
>> of sleep must be blinding me.
>>
>> Any ideas?
>>
>> -- TRW
>
> Hey Tim,
>
> Any chance it's an error handler that doesn't give you any visible
> feedback?
>
> - John

Hmmm... that's a thought. I don't think so, since, if I step
through the code with the debugger, when I step past this
line, it just goes to the next line after it. Normally, if
I have an error handler and I hit an error while stepping
in the debugger, I go into the error handler code.

I'll take a closer look at that though, thanks. It's an odd one.

-- TRW
_______________________________________
t r w 7
at
i x dot n e t c o m dot c o m
_______________________________________

Re: SQL SELECT is not executing by trw7at

trw7at
Fri May 06 16:56:22 CDT 2005

Tim Witort seemed to utter in
news:Xns964E7A83ABE89timwitortwrotethis@207.217.125.201:

> VFP 8 SP1 on XP Pro SP1
>
> This is the most bizarre thing I've seen in a long time. I had some
> code in a form that constructed a SQL SELECT statement as a string,
> then runs the command via macro substituion (&). This was working fine.
>
> I decided to move this code into a class. Now, when the macro
> substitution line is executed, nothing happens. Here is the string
> that is supposed to be executed:
>
> SELECT Employee_name AS fld1, UPPER(Employee_name), Ssn AS fld2,
> UPPER(Ssn), Employee_id AS fld3, UPPER(Employee_id), Dob AS fld4,
> UPPER(Dob) INTO CURSOR rptCurs FROM empGrpCurs ORDER BY 2, 4, 6, 8
>
> The source cursor (empGrpCurs) exists and contains data. After
> this instruction is executed (or not executed in this case), the
> destination cursor (rptCurs) does not exist and _TALLY has not been
> updated from the prior value. No error is raised. It's like this
> instruction never happened. I then placed the actual SQL SELECT
> statement (rather than the macro version) in this same method a
> few lines lower and the result was exactly the same - no error,
> no cursor created, _TALLY unchanged.
>
> I'm convinced I'm just missing something very obvious, but lack
> of sleep must be blinding me.

I found the cause for this behavior...

If you look at the SELECT statement, the field employee_id
is being used in the UPPER() command, but it is a numeric
field. My base form class does have an Error method, but I
had temporarily disabled it by sticking a "*" in the Error
method in this form instance and I never removed this. So,
the SELECT failed due to a type mismatch and I happened to
have the Error method crippled.

So you were right, John. Thanks for the lead.

-- TRW
_______________________________________
t r w 7
at
i x dot n e t c o m dot c o m
_______________________________________

Re: SQL SELECT is not executing by Gene

Gene
Tue May 10 16:55:54 CDT 2005

On Fri, 06 May 2005 21:56:22 GMT, trw7at@ixdot.netcomdotcom (Tim
Witort) wrote:

[snip]

>I found the cause for this behavior...
>
>If you look at the SELECT statement, the field employee_id
>is being used in the UPPER() command, but it is a numeric
>field. My base form class does have an Error method, but I
>had temporarily disabled it by sticking a "*" in the Error
>method in this form instance and I never removed this. So,
>the SELECT failed due to a type mismatch and I happened to
>have the Error method crippled.
>
>So you were right, John. Thanks for the lead.

Another possibility for code not getting executed is a comment
ending with a semi-colon.
* The apparently-next statement is actually part of the
* second line of this comment;
? "Here I am!" && actually part of a comment

Sincerely,

Gene Wirchenko