>Thank you, Dragan.
>
>I see your point but I think this is not fully the case of missing or being baffled with This reference.
>
>I rewrote the Parameters Collection class as Empty and the program works fine (that is, recognizes the parameter source):
>
> FUNCTION buildQuery
>
> SQLPREPARE(This.Remote, "SELECT * FROM " + This.TableName + ;
> " WHERE " + This.RowId + " = ?This.Parameters.id")
>
> ENDFUNC
>
>
>And I know it's not a don't-call-an-object-method issue because I circumvent the problem by creating a local reference the This.Parameters Collection, not by putting the value of its items in variables.
Hi Antonio:
If you open VFP Help and, on search tab, you write "sql and parameters", you will find that Dragan is right,
Even if using properties (like "?This.Parameters.id") may work, they are intended for variables, and there is reason for this. If you look at "Using SQL Server Input/Output Parameters" chapter, you will find this between other examples:
resultCode = SQLExec(connHand,
"CREATE PROCEDURE sp_test;
@mult1 int, @mult2 int, @result int;
OUTPUT AS SELECT
@result = @mult1 * @mult2")
or this one:
resultCode = SQLExec(connHand, ;
"{CALL sp_test (2, 4, ?@outParam)}")
Some variables are for input and output, which means that the value can be replaced, and this won't happen with properties.
And in this chapter, the "Defining Parameters" section states this:
"When you implement input/output parameters, define the Visual FoxPro variables you want to include in your SQL pass-through command before you use the variables in the SQL statement"
As you see, it mention "VFP variables", not properties. May be properties work for "input only" data, but I'm not sure of the special cases of this use.
Regards.-
Fernando D. Bozzo
Madrid / Spain