I am trying to set the command text of a dataenvironment command at run time and am haveing a problem that I have not experienced before. ie.
I set the SQL string to the commandtext property
strSQL = "SHAPE {SELECT * FROM viewEmployees ORDER BY LastName} AS sqlEmployees APPEND ({SELECT * FROM `viewRequests`} AS sqlRequests RELATE 'ID' TO 'EmployeeID') AS sqlRequests"
DataEnv.Commands.Item("sqlEmployees").CommandText = strSQL
'Run the new command
DataEnv.sqlEmployees
This is where the error appears.
It says Invalid syntax in from clause.
The reason it says this is b/c for some reason if I display the commandtext property in the debug window it reads
select * from SHAPE {SELECT * FROM viewEmployees ORDER BY LastName} AS sqlEmployees APPEND ({SELECT * FROM `viewRequests`} AS sqlRequests RELATE 'ID' TO 'EmployeeID') AS sqlRequests
Why is that "select * from " appear? It never used to but now it does?!?!?!